From 5acd0590258e9335cf4d3b1910a517efccd22a3e Mon Sep 17 00:00:00 2001 From: Fabian Schillinger Date: Fri, 9 Jul 2010 21:18:44 +0200 Subject: first commit to test git --- src/net/pvsServerConnection.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/net/pvsServerConnection.cpp') diff --git a/src/net/pvsServerConnection.cpp b/src/net/pvsServerConnection.cpp index 04a1ef6..1ce9904 100644 --- a/src/net/pvsServerConnection.cpp +++ b/src/net/pvsServerConnection.cpp @@ -133,6 +133,14 @@ void PVSServerConnection::onPing(PVSMsg pingmsg) } } +/* Hier werden Nachrichten behandelt, die vom Client kommen + * + * + * + * + * + */ + void PVSServerConnection::handleClientMsg(PVSMsg receiver) { // FIXME: @SimonR, this line cuase problems with pvs in daemon mode and dbus -- cgit v1.2.3-55-g7522 From d2d403a8dec0f65bb3665c2bd2dab69456cdee42 Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Sat, 10 Jul 2010 00:11:47 +0200 Subject: Revoke Fabians changes. --- i18n/pvs_ar_JO.ts | 8 +- i18n/pvs_de_DE.ts | 8 +- i18n/pvs_es_MX.ts | 8 +- i18n/pvs_fr_FR.ts | 8 +- i18n/pvs_pl_PL.ts | 8 +- i18n/pvsmgr_ar_JO.ts | 170 +++++++++++++++++--------------------- i18n/pvsmgr_de_DE.ts | 170 +++++++++++++++++--------------------- i18n/pvsmgr_es_MX.ts | 170 +++++++++++++++++--------------------- i18n/pvsmgr_fr_FR.ts | 170 +++++++++++++++++--------------------- i18n/pvsmgr_pl_PL.ts | 170 +++++++++++++++++--------------------- src/core/pvsConnectionManager.cpp | 10 --- src/gui/connectionList.cpp | 23 ------ src/gui/connectionList.h | 1 - src/gui/connectionWindow.cpp | 2 + src/gui/mainWindow.cpp | 35 -------- src/gui/mainWindow.h | 1 - src/gui/ui/mainwindow.ui | 19 +---- src/gui/ui/mainwindowtouch.ui | 17 +--- src/net/pvsListenServer.cpp | 4 +- src/net/pvsServerConnection.cpp | 8 -- src/pvs.cpp | 12 --- src/pvsDaemon.cpp | 21 ++--- src/util/util.cpp | 7 ++ src/util/util.h | 1 + src/version.h | 4 +- 25 files changed, 435 insertions(+), 620 deletions(-) (limited to 'src/net/pvsServerConnection.cpp') diff --git a/i18n/pvs_ar_JO.ts b/i18n/pvs_ar_JO.ts index 7443e4b..0b4c72f 100644 --- a/i18n/pvs_ar_JO.ts +++ b/i18n/pvs_ar_JO.ts @@ -4,22 +4,22 @@ PVS - + Message - + VNC connection - + The host - + requested your screen! diff --git a/i18n/pvs_de_DE.ts b/i18n/pvs_de_DE.ts index 7443e4b..0b4c72f 100644 --- a/i18n/pvs_de_DE.ts +++ b/i18n/pvs_de_DE.ts @@ -4,22 +4,22 @@ PVS - + Message - + VNC connection - + The host - + requested your screen! diff --git a/i18n/pvs_es_MX.ts b/i18n/pvs_es_MX.ts index 7443e4b..0b4c72f 100644 --- a/i18n/pvs_es_MX.ts +++ b/i18n/pvs_es_MX.ts @@ -4,22 +4,22 @@ PVS - + Message - + VNC connection - + The host - + requested your screen! diff --git a/i18n/pvs_fr_FR.ts b/i18n/pvs_fr_FR.ts index 7443e4b..0b4c72f 100644 --- a/i18n/pvs_fr_FR.ts +++ b/i18n/pvs_fr_FR.ts @@ -4,22 +4,22 @@ PVS - + Message - + VNC connection - + The host - + requested your screen! diff --git a/i18n/pvs_pl_PL.ts b/i18n/pvs_pl_PL.ts index 7443e4b..0b4c72f 100644 --- a/i18n/pvs_pl_PL.ts +++ b/i18n/pvs_pl_PL.ts @@ -4,22 +4,22 @@ PVS - + Message - + VNC connection - + The host - + requested your screen! diff --git a/i18n/pvsmgr_ar_JO.ts b/i18n/pvsmgr_ar_JO.ts index cac57b4..bc5c69c 100644 --- a/i18n/pvsmgr_ar_JO.ts +++ b/i18n/pvsmgr_ar_JO.ts @@ -212,9 +212,9 @@ Perform an unprojection or remove remote help to get a target. - - - + + + You have to set a Superclient-machine before performing this action. @@ -314,376 +314,360 @@ Perform an unprojection or remove remote help to get a target. MainWindow - - + + Exit - + Remove the vnc-Connection for the selected client(s) - + Show the selected client in the whole window - + Make a screenshot for the selected client(s) - - + + Lock or Unlock all Clients - - Shows list of processes of this client - - - - + The pvs manager - - + This operation can only be performed for one selected Client! - + This operation can only be performed for at least one selected Client! - + You have to set a Superclient-machine before performing this action. - + Open Image - + Image Files (*.png *.jpg *.svg) - + PVSmgr - + Show Username - + Ctrl+3 - + Show IP - + Ctrl+2 - + VNC-Placeholders - + Show Log - + Ctrl+L - + Show Normal - + Ctrl+O - + Show Error - + Ctrl+E - + Show Network - + Ctrl+N - + Show Terminal - + Ctrl+T - + Show Chat - + Ctrl+G - + About pvs - + Ctrl+P - + 100 x 100 - + 200 x 200 - + 500 x 500 - + &Disconnect - + Ctrl+W - + &Exit - + Ctrl+Q - - + + Foto - + Ctrl+F - + view - + View - + Ctrl+V - + lock - + Ctrl+A - + Profile &manager - + Ctrl+M - + Show Name - + Ctrl+1 - + Chat - + Start Chat with client(s) - + Ctrl+D - + - - - Show Processes - - - - - show processes of this client - - - - + border-color: rgb(0, 0, 0); - + VNC quality - + HIGH - + MEDIUM - + LOW - + Set password - + Thumbnailratio - + Thumbnailrate - + 0 - + % - + background-color: rgb(255, 255, 255); - + background-color: rgb(150, 150, 150); - + &File - + Load profile - + &Clients - + &Logging - + &Help - + toolBar diff --git a/i18n/pvsmgr_de_DE.ts b/i18n/pvsmgr_de_DE.ts index 4393aa3..fd6d56b 100644 --- a/i18n/pvsmgr_de_DE.ts +++ b/i18n/pvsmgr_de_DE.ts @@ -212,9 +212,9 @@ Perform an unprojection or remove remote help to get a target. - - - + + + You have to set a Superclient-machine before performing this action. @@ -314,376 +314,360 @@ Perform an unprojection or remove remote help to get a target. MainWindow - - + + Exit - + Remove the vnc-Connection for the selected client(s) - + Show the selected client in the whole window - + Make a screenshot for the selected client(s) - - + + Lock or Unlock all Clients - - Shows list of processes of this client - - - - + The pvs manager - - + This operation can only be performed for one selected Client! - + This operation can only be performed for at least one selected Client! - + You have to set a Superclient-machine before performing this action. - + Open Image - + Image Files (*.png *.jpg *.svg) - + PVSmgr - + Show Username - + Ctrl+3 - + Show IP - + Ctrl+2 - + VNC-Placeholders - + Show Log - + Ctrl+L - + Show Normal - + Ctrl+O - + Show Error - + Ctrl+E - + Show Network - + Ctrl+N - + Show Terminal - + Ctrl+T - + Show Chat - + Ctrl+G - + About pvs - + Ctrl+P - + 100 x 100 - + 200 x 200 - + 500 x 500 - + &Disconnect - + Ctrl+W - + &Exit - + Ctrl+Q - - + + Foto - + Ctrl+F - + view - + View - + Ctrl+V - + lock - + Ctrl+A - + Profile &manager - + Ctrl+M - + Show Name - + Ctrl+1 - + Chat - + Start Chat with client(s) - + Ctrl+D - + - - - Show Processes - - - - - show processes of this client - - - - + border-color: rgb(0, 0, 0); - + VNC quality - + HIGH - + MEDIUM - + LOW - + Set password - + Thumbnailratio - + Thumbnailrate - + 0 - + % - + background-color: rgb(255, 255, 255); - + background-color: rgb(150, 150, 150); - + &File - + Load profile - + &Clients - + &Logging - + &Help - + toolBar diff --git a/i18n/pvsmgr_es_MX.ts b/i18n/pvsmgr_es_MX.ts index 758b277..fc53e6d 100644 --- a/i18n/pvsmgr_es_MX.ts +++ b/i18n/pvsmgr_es_MX.ts @@ -212,9 +212,9 @@ Perform an unprojection or remove remote help to get a target. &Agregar un dummy... - - - + + + You have to set a Superclient-machine before performing this action. Usted debe asignar un super cliente antes de iniciar esta acción. @@ -314,376 +314,360 @@ Perform an unprojection or remove remote help to get a target. MainWindow - - + + Exit Salir - + Remove the vnc-Connection for the selected client(s) Remover la conexión VNC de los clientes seleccionados - + Show the selected client in the whole window Mostrar el cliente seleccionado en toda la ventana - + Make a screenshot for the selected client(s) Capturar la pantalla de los clientes seleccionados - - + + Lock or Unlock all Clients Bloquear o desbloquear todos los clientes - - Shows list of processes of this client - - - - + The pvs manager PVS Manager - - + This operation can only be performed for one selected Client! Esta operación solamente puede ser realizada para un cliente! - + This operation can only be performed for at least one selected Client! Esta operación solamente puede ser realizada para el ultimo cliente seleccionado! - + You have to set a Superclient-machine before performing this action. Usted debe asignar un super cliente antes de realizar esta acción. - + Open Image Abrir imagen - + Image Files (*.png *.jpg *.svg) Extensión de imagenes (*.png *.jpg *.svg) - + PVSmgr PVSmgr - + Show Username Mostrar nombre de usuario - + Ctrl+3 Ctrl+3 - + Show IP Mostrar IP - + Ctrl+2 Ctrl+2 - + VNC-Placeholders VNC - Marcadores de posición - + Show Log Mostrar Log - + Ctrl+L Ctrl+L - + Show Normal Mostrar normal - + Ctrl+O Ctrl+O - + Show Error Mostrar Errores - + Ctrl+E Ctrl+E - + Show Network Mostrar Red - + Ctrl+N - + Show Terminal Mostrar Linea de comandos - + Ctrl+T Ctrl+T - + Show Chat Mostrar Chat - + Ctrl+G Ctrl+G - + About pvs Acerca de PVS - + Ctrl+P Ctrl+P - + 100 x 100 100 x 100 - + 200 x 200 200 x 200 - + 500 x 500 500 x 500 - + &Disconnect &Desconectar - + Ctrl+W Ctrl+W - + &Exit &Salir - + Ctrl+Q Ctrl+Q - - + + Foto Imagen - + Ctrl+F Ctrl+F - + view ver - + View Ver - + Ctrl+V Ctrl+V - + lock bloquear - + Ctrl+A Ctrl+A - + Profile &manager Perfil &manager - + Ctrl+M Ctrl+M - + Show Name Mostrar nombre - + Ctrl+1 Ctrl+1 - + Chat Chat - + Start Chat with client(s) Iniciar Chat con cliente(s) - + Ctrl+D Ctrl+D - + - - - - Show Processes - - - - - show processes of this client - - - - + border-color: rgb(0, 0, 0); border-color: rgb(0, 0, 0); - + VNC quality VNC calidad - + HIGH Alta - + MEDIUM Media - + LOW Baja - + Set password Asignar contraseña - + Thumbnailratio Radio de la vista en miniatura - + Thumbnailrate Frecuancia de actualización para las vistas en miniatura - + 0 0 - + % % - + background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255); - + background-color: rgb(150, 150, 150); background-color: rgb(150, 150, 150); - + &File &Archivo - + Load profile Cargar perfil - + &Clients &Clientes - + &Logging &Logging - + &Help &Ayuda - + toolBar Barra de herramientas diff --git a/i18n/pvsmgr_fr_FR.ts b/i18n/pvsmgr_fr_FR.ts index cac57b4..bc5c69c 100644 --- a/i18n/pvsmgr_fr_FR.ts +++ b/i18n/pvsmgr_fr_FR.ts @@ -212,9 +212,9 @@ Perform an unprojection or remove remote help to get a target. - - - + + + You have to set a Superclient-machine before performing this action. @@ -314,376 +314,360 @@ Perform an unprojection or remove remote help to get a target. MainWindow - - + + Exit - + Remove the vnc-Connection for the selected client(s) - + Show the selected client in the whole window - + Make a screenshot for the selected client(s) - - + + Lock or Unlock all Clients - - Shows list of processes of this client - - - - + The pvs manager - - + This operation can only be performed for one selected Client! - + This operation can only be performed for at least one selected Client! - + You have to set a Superclient-machine before performing this action. - + Open Image - + Image Files (*.png *.jpg *.svg) - + PVSmgr - + Show Username - + Ctrl+3 - + Show IP - + Ctrl+2 - + VNC-Placeholders - + Show Log - + Ctrl+L - + Show Normal - + Ctrl+O - + Show Error - + Ctrl+E - + Show Network - + Ctrl+N - + Show Terminal - + Ctrl+T - + Show Chat - + Ctrl+G - + About pvs - + Ctrl+P - + 100 x 100 - + 200 x 200 - + 500 x 500 - + &Disconnect - + Ctrl+W - + &Exit - + Ctrl+Q - - + + Foto - + Ctrl+F - + view - + View - + Ctrl+V - + lock - + Ctrl+A - + Profile &manager - + Ctrl+M - + Show Name - + Ctrl+1 - + Chat - + Start Chat with client(s) - + Ctrl+D - + - - - Show Processes - - - - - show processes of this client - - - - + border-color: rgb(0, 0, 0); - + VNC quality - + HIGH - + MEDIUM - + LOW - + Set password - + Thumbnailratio - + Thumbnailrate - + 0 - + % - + background-color: rgb(255, 255, 255); - + background-color: rgb(150, 150, 150); - + &File - + Load profile - + &Clients - + &Logging - + &Help - + toolBar diff --git a/i18n/pvsmgr_pl_PL.ts b/i18n/pvsmgr_pl_PL.ts index cac57b4..bc5c69c 100644 --- a/i18n/pvsmgr_pl_PL.ts +++ b/i18n/pvsmgr_pl_PL.ts @@ -212,9 +212,9 @@ Perform an unprojection or remove remote help to get a target. - - - + + + You have to set a Superclient-machine before performing this action. @@ -314,376 +314,360 @@ Perform an unprojection or remove remote help to get a target. MainWindow - - + + Exit - + Remove the vnc-Connection for the selected client(s) - + Show the selected client in the whole window - + Make a screenshot for the selected client(s) - - + + Lock or Unlock all Clients - - Shows list of processes of this client - - - - + The pvs manager - - + This operation can only be performed for one selected Client! - + This operation can only be performed for at least one selected Client! - + You have to set a Superclient-machine before performing this action. - + Open Image - + Image Files (*.png *.jpg *.svg) - + PVSmgr - + Show Username - + Ctrl+3 - + Show IP - + Ctrl+2 - + VNC-Placeholders - + Show Log - + Ctrl+L - + Show Normal - + Ctrl+O - + Show Error - + Ctrl+E - + Show Network - + Ctrl+N - + Show Terminal - + Ctrl+T - + Show Chat - + Ctrl+G - + About pvs - + Ctrl+P - + 100 x 100 - + 200 x 200 - + 500 x 500 - + &Disconnect - + Ctrl+W - + &Exit - + Ctrl+Q - - + + Foto - + Ctrl+F - + view - + View - + Ctrl+V - + lock - + Ctrl+A - + Profile &manager - + Ctrl+M - + Show Name - + Ctrl+1 - + Chat - + Start Chat with client(s) - + Ctrl+D - + - - - Show Processes - - - - - show processes of this client - - - - + border-color: rgb(0, 0, 0); - + VNC quality - + HIGH - + MEDIUM - + LOW - + Set password - + Thumbnailratio - + Thumbnailrate - + 0 - + % - + background-color: rgb(255, 255, 255); - + background-color: rgb(150, 150, 150); - + &File - + Load profile - + &Clients - + &Logging - + &Help - + toolBar diff --git a/src/core/pvsConnectionManager.cpp b/src/core/pvsConnectionManager.cpp index aabd869..8a35ca9 100644 --- a/src/core/pvsConnectionManager.cpp +++ b/src/core/pvsConnectionManager.cpp @@ -93,14 +93,6 @@ void PVSConnectionManager::onClientRemove(PVSClientConnection* removedConnection } // Inform all chat clients about a new event. -// hier eventuell prozesse anzeigen einbinden -// -// -// -// -// -// -// void PVSConnectionManager::sendEventToClients(QString event, PVSClientConnection* connection, QString clientName) { if(event.compare("addedConnection") == 0) @@ -117,8 +109,6 @@ void PVSConnectionManager::sendEventToClients(QString event, PVSClientConnection if(event.compare("addedClient") == 0) { // send name to everybody to all connected clients. - _pvsServer.sendToAll(PVSMsg(PVSCOMMAND, "SHOWPROCESSES", "")); - ConsoleLog writeNetwork("SHOWPROCESSES sent..."); _pvsServer.sendToAll(PVSMsg(PVSMESSAGE, "clientToAdd", ":" + clientName, 0)); connection->push_back_send(PVSMsg(PVSMESSAGE, "assignedName", ":" + clientName, 0)); connection->push_back_send(PVSMsg(PVSMESSAGE, "clientToAdd", ":PVSMGR:local", 0)); diff --git a/src/gui/connectionList.cpp b/src/gui/connectionList.cpp index 61be876..2f9829e 100644 --- a/src/gui/connectionList.cpp +++ b/src/gui/connectionList.cpp @@ -432,14 +432,6 @@ void ConnectionList::on_remoteHelp() } } -/* - * - */ -void ConnectionList::showProcesses() -{ - MainWindow::getConnectionWindow()->messageStations("BROADCAST","SHOWPROCESSES"); -} - void ConnectionList::on_lock() { MainWindow::getConnectionWindow()->lockStations(); @@ -450,21 +442,6 @@ void ConnectionList::on_unlock() MainWindow::getConnectionWindow()->unlockStations(); } -/* Hier werden Nachrichten vom Server versendet: -* Type: PVSMESSAGE -* Ident: BROADCAST -* Msg: die Nachricht -* -* Wenn Ident: LOCKSTATION -> locke Client -* -* -* -* -* -* -* -*/ - void ConnectionList::on_message() { Dialog msgD; diff --git a/src/gui/connectionList.h b/src/gui/connectionList.h index 29dd174..50d8924 100644 --- a/src/gui/connectionList.h +++ b/src/gui/connectionList.h @@ -108,7 +108,6 @@ public slots: virtual void on_projection(); virtual void on_unprojection(); virtual void on_lock(); - virtual void showProcesses(); virtual void on_unlock(); virtual void on_message(); virtual void on_lock_with_message(); diff --git a/src/gui/connectionWindow.cpp b/src/gui/connectionWindow.cpp index 9e7b370..cf51051 100644 --- a/src/gui/connectionWindow.cpp +++ b/src/gui/connectionWindow.cpp @@ -263,6 +263,8 @@ bool ConnectionWindow::remoteHelp(QString sname) { } + + bool ConnectionWindow::lockStations() { if (std::list* lockList = MainWindow::getConnectionList()->getSelectedClients()) { if (!lockList->empty()) { diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp index 4cd6997..eb15e82 100644 --- a/src/gui/mainWindow.cpp +++ b/src/gui/mainWindow.cpp @@ -116,10 +116,6 @@ MainWindow::MainWindow(QWidget *parent) : // toolbar and actions in pvsmgr - - //testweise chat starten beim klicken auf processlist - connect(ui->actionShowProcesses, SIGNAL(triggered()), this, SLOT(showProcesses())); - ui->actionShowProcesses->setStatusTip(tr("Shows list of processes of this client")); connect(ui->action_Exit, SIGNAL(triggered()), this, SLOT(close())); ui->action_Exit->setStatusTip(tr("Exit")); connect(ui->action_Disconnect, SIGNAL(triggered()), this, SLOT(disconnect())); @@ -134,8 +130,6 @@ MainWindow::MainWindow(QWidget *parent) : ui->actionLock->setStatusTip(tr("Lock or Unlock all Clients")); connect(ui->actionCreate_profile, SIGNAL(triggered()), this, SLOT(createProfile())); - - connect(ui->actionShow_Username, SIGNAL(triggered()), this, SLOT(showusername())); connect(ui->actionShow_Hostname_IP, SIGNAL(triggered()), this, SLOT(showip())); connect(ui->actionShow_Fullname, SIGNAL(triggered()), this, SLOT(showname())); @@ -801,35 +795,6 @@ void MainWindow::foto() // makes a screenshot of the selected client } } -/* - * test if a client is selected and then make him tell his processlist - * - * - * - * - * - */ - -void MainWindow::showProcesses() -{ - std::list* selectedClients = - MainWindow::getConnectionList()->getSelectedClients(); - if (selectedClients->size() == 1) - { - // do stuff - } - else - { - QString - message = - QString( - tr( - "This operation can only be performed for one selected Client!")); - QMessageBox::information(this, "PVS", message); - } -} - - void MainWindow::createProfile() { profileDialog proDiag; diff --git a/src/gui/mainWindow.h b/src/gui/mainWindow.h index 5e20af2..00bd927 100644 --- a/src/gui/mainWindow.h +++ b/src/gui/mainWindow.h @@ -171,7 +171,6 @@ public slots: void projecttoolbar(); void unprojecttoolbar(); void closeUp(); - void showProcesses(); void foto(); void backgroundpicture(); void repaintbackgroundpicture(); diff --git a/src/gui/ui/mainwindow.ui b/src/gui/ui/mainwindow.ui index b5ac0e3..eb49d1b 100644 --- a/src/gui/ui/mainwindow.ui +++ b/src/gui/ui/mainwindow.ui @@ -28,8 +28,8 @@ 0 0 - 778 - 542 + 776 + 534 @@ -195,7 +195,7 @@ 0 0 838 - 23 + 28 @@ -286,7 +286,6 @@ - @@ -532,18 +531,6 @@ - - - - - :/finder:/finder - - - Show Processes - - - show processes of this client - - diff --git a/src/gui/ui/mainwindowtouch.ui b/src/gui/ui/mainwindowtouch.ui index f8e76c0..9030b17 100644 --- a/src/gui/ui/mainwindowtouch.ui +++ b/src/gui/ui/mainwindowtouch.ui @@ -28,8 +28,8 @@ 0 0 - 1329 - 660 + 1327 + 658 @@ -365,7 +365,6 @@ - @@ -637,18 +636,6 @@ Ctrl+D - - - - :/finder:/finder - - - Show Processes - - - show processes of this client - - diff --git a/src/net/pvsListenServer.cpp b/src/net/pvsListenServer.cpp index 1dac9c0..f21303e 100644 --- a/src/net/pvsListenServer.cpp +++ b/src/net/pvsListenServer.cpp @@ -245,8 +245,8 @@ bool PVSListenServer::init() return false; } ConsoleLog writeNetwork( - QString("Server is listening. Socket: ").append(int2String( - (int) _listenSocket))); + QString("Server is listening. Socket: ").append(ptr2String( + _listenSocket))); connect(_listenSocket, SIGNAL(newConnection()), this, SLOT( server_connectionRequest())); diff --git a/src/net/pvsServerConnection.cpp b/src/net/pvsServerConnection.cpp index 1ce9904..04a1ef6 100644 --- a/src/net/pvsServerConnection.cpp +++ b/src/net/pvsServerConnection.cpp @@ -133,14 +133,6 @@ void PVSServerConnection::onPing(PVSMsg pingmsg) } } -/* Hier werden Nachrichten behandelt, die vom Client kommen - * - * - * - * - * - */ - void PVSServerConnection::handleClientMsg(PVSMsg receiver) { // FIXME: @SimonR, this line cuase problems with pvs in daemon mode and dbus diff --git a/src/pvs.cpp b/src/pvs.cpp index 1531c3d..2069e36 100644 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -176,18 +176,6 @@ void PVS::onCommand(PVSMsg cmdMessage) unlock(); return; } - if (ident.compare("SHOWPROCESSES") == 0) - { - // show processes - // ConsoleLog writeNetwork(system("ps -f -N -U root")); - // emit showMessage("SHOWPROCESSES", "proce", true); - return; - } - if (ident.compare("KILLPROCESS") == 0) - { - // do stuff if process has to be killed - return; - } #ifdef never // prototype diff --git a/src/pvsDaemon.cpp b/src/pvsDaemon.cpp index 961e0f3..e87bfe7 100644 --- a/src/pvsDaemon.cpp +++ b/src/pvsDaemon.cpp @@ -66,11 +66,13 @@ int main(int argc, char** argv) { int frequency = 5; int port = -1; - QString homeDir("/home/"); - QString scriptPath = homeDir; - scriptPath.append(getUserName().append(QString("/.pvs/pvs-vncsrv"))); - QString scriptName; - scriptName = getFilenameFromPath(scriptPath); + + QFileInfo script; + script.setFile("/usr/bin/pvs-vncsrv"); + if (!script.exists()) + script.setFile("/usr/local/bin/pvs-vncsrv"); + if (!script.exists()) + script.setFile("/home/" + getUserName() + "/.pvs/pvs-vncsrv"); QCoreApplication app(argc, argv); app.setOrganizationName("openslx"); @@ -259,8 +261,7 @@ int main(int argc, char** argv) { if (option_index + 1 < argc) { - scriptPath = QString(argv[option_index + 1]); - scriptName = getFilenameFromPath(scriptPath); + script.setFile(QString(argv[option_index + 1])); option_index++; continue; } @@ -347,13 +348,13 @@ int main(int argc, char** argv) if (port <= 0) port = SERVER_PORT_INT; ConsoleLog writeLine(QString("TCP-Port: ").append(int2String(port))); - mainClient->setScriptPath(scriptPath); - ConsoleLog writeLine(QString("VNCScriptPath: ").append(scriptPath)); + mainClient->setScriptPath(script.filePath()); + ConsoleLog writeLine(QString("VNCScriptPath: ").append(script.filePath())); createPolicyDir(); createPolicyFiles(); // long int gr = 0; - mainClient->setScriptPath(scriptPath); + mainClient->setScriptPath(script.filePath()); app.exec(); delete mainClient; diff --git a/src/util/util.cpp b/src/util/util.cpp index c2d06a0..946168e 100644 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -325,6 +325,13 @@ QString int2String(int intInt) return QString(tmp); } +QString ptr2String(void* ptr) +{ + char tmp[50]; + snprintf(tmp, 49, "%p", ptr); + return QString(tmp); +} + int string2Int(QString string) { return atoi(string.toUtf8().data()); diff --git a/src/util/util.h b/src/util/util.h index 37565cb..6ddefc6 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -46,6 +46,7 @@ QString readPassFromPassFile(); bool getAllowed(); QString int2String(int intInt); +QString ptr2String(void* ptr); int string2Int(QString string); int string2Int(QString string); //} // end namespace util diff --git a/src/version.h b/src/version.h index c217c07..ac24ac2 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1,2 @@ -#define VERSION_STRING "1.9.8.0" -#define VERSION_NUMBER 1980 +#define VERSION_STRING "2.0.1.0" +#define VERSION_NUMBER 2010 -- cgit v1.2.3-55-g7522 From f6fca1c3c5279c820be3860b0074831f920219d6 Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Wed, 1 Sep 2010 01:02:39 +0200 Subject: All printf() replaced with qDebug() --- CMakeLists.txt | 6 +----- src/gui/mainWindow.cpp | 2 +- src/net/SslServer.cpp | 4 ++-- src/net/pvsClientConnection.cpp | 2 +- src/net/pvsDiscoveredServer.cpp | 22 +++++++++++----------- src/net/pvsListenServer.cpp | 7 +++---- src/net/pvsListenServer.h | 2 +- src/net/pvsLocalhostCommunicator.cpp | 6 +++--- src/net/pvsServerConnection.cpp | 2 +- src/net/pvsServiceDiscovery.cpp | 2 +- src/pvs.cpp | 4 ++-- src/pvsDaemon.cpp | 29 ++++++++++++++--------------- src/util/consoleLogger.cpp | 2 +- src/util/consoleLogger.h | 2 +- src/util/util.cpp | 6 +++--- 15 files changed, 46 insertions(+), 52 deletions(-) (limited to 'src/net/pvsServerConnection.cpp') diff --git a/CMakeLists.txt b/CMakeLists.txt index a98022d..fa4da6a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,15 +11,11 @@ CMAKE_MINIMUM_REQUIRED( VERSION 2.6.2 ) # set compiler optimizations for debug and release SET(CMAKE_BUILD_TYPE Debug) SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall") -SET(CMAKE_CXX_FLAGS_RELEASE "-O2" ) -#-march=native -DQT_NO_DEBUG_OUTPUT +SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DQT_NO_DEBUG_OUTPUT" ) # local cmake modules SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) -#Test -SET(CMAKE_EDIT_COMMAND ${CMAKE_SOURCE_DIR}) - # this command finds libraries and sets all required variables FIND_PACKAGE( Qt4 4.5.0 REQUIRED ) FIND_PACKAGE( X11 REQUIRED ) diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp index bea636f..10c64d6 100644 --- a/src/gui/mainWindow.cpp +++ b/src/gui/mainWindow.cpp @@ -813,7 +813,7 @@ void MainWindow::foto() // makes a screenshot of the selected client img.save(path, format.toAscii()); } else - printf("Cannot save screen: Image is null.\n"); + qDebug("Cannot save screen: Image is null."); } } else diff --git a/src/net/SslServer.cpp b/src/net/SslServer.cpp index e353e0a..9940a61 100644 --- a/src/net/SslServer.cpp +++ b/src/net/SslServer.cpp @@ -59,7 +59,7 @@ void SslServer::incomingConnection(int socketDescriptor) void SslServer :: sslErrors ( const QList & errors ) { - printf("FIXME: SSL ERRORS on SERVER: %s\n", errors.begin()->errorString().toUtf8().data()); + qDebug("FIXME: SSL ERRORS on SERVER: %s", qPrintable(errors.begin()->errorString())); } void SslServer::timerEvent (QTimerEvent* event) @@ -98,7 +98,7 @@ bool SslServer::hasPendingConnections() { for (QList::iterator it = _pending.begin(); it != _pending.end(); it++) { - printf("State: %d - Encrypted: %d\n", (int)(*it)->state(), (*it)->isEncrypted()); + qDebug("State: %d - Encrypted: %d", (int)(*it)->state(), (*it)->isEncrypted()); if ((*it)->state() == QAbstractSocket::ConnectedState && (*it)->isEncrypted()) return true; } return false; diff --git a/src/net/pvsClientConnection.cpp b/src/net/pvsClientConnection.cpp index dff40d5..5354e95 100644 --- a/src/net/pvsClientConnection.cpp +++ b/src/net/pvsClientConnection.cpp @@ -134,7 +134,7 @@ bool PVSClientConnection::push_back_send(PVSMsg newMsg) char *tmp = data; if (!newMsg.getBinaryData(tmp, len)) { - printf("Message empty. Ignored.\n"); + qDebug("Message empty. Ignored."); return false; } QByteArray ba; diff --git a/src/net/pvsDiscoveredServer.cpp b/src/net/pvsDiscoveredServer.cpp index dddb5a0..efa1506 100644 --- a/src/net/pvsDiscoveredServer.cpp +++ b/src/net/pvsDiscoveredServer.cpp @@ -48,7 +48,7 @@ void PVSDiscoveredServer::ssl_Error( const QList & errors ) } //ConsoleLog writeNetwork(err.errorString().toUtf8().data()); //ConsoleLog writeNetwork("***** SSL ERROR, ABORTING *****"); - printf("Unhandled SSL Error in SD: %s\n", err.errorString().toUtf8().data()); + qDebug("Unhandled SSL Error in SD: %s", qPrintable(err.errorString())); return; } _socket->ignoreSslErrors(); @@ -70,30 +70,30 @@ void PVSDiscoveredServer::sock_connected() QByteArray cert = _socket->peerCertificate().digest(QCryptographicHash::Sha1); if (_socket->peerCertificate().isNull()) { - printf("**** WARNING - PEER CERTIFICATE IS NULL ****\n"); + qDebug("**** WARNING - PEER CERTIFICATE IS NULL ****"); } else { - printf("%s\n", _socket->peerCertificate().subjectInfo(QSslCertificate::Organization).toUtf8().data()); - printf("%s\n", _socket->peerCertificate().subjectInfo(QSslCertificate::CommonName).toUtf8().data()); - printf("%s\n", _socket->peerCertificate().subjectInfo(QSslCertificate::LocalityName).toUtf8().data()); - printf("%s\n", _socket->peerCertificate().subjectInfo(QSslCertificate::OrganizationalUnitName ).toUtf8().data()); - printf("%s\n", _socket->peerCertificate().subjectInfo(QSslCertificate::CountryName ).toUtf8().data()); - printf("%s\n", _socket->peerCertificate().subjectInfo(QSslCertificate::StateOrProvinceName ).toUtf8().data()); + qDebug("%s", qPrintable(_socket->peerCertificate().subjectInfo(QSslCertificate::Organization))); + qDebug("%s", qPrintable(_socket->peerCertificate().subjectInfo(QSslCertificate::CommonName))); + qDebug("%s", qPrintable(_socket->peerCertificate().subjectInfo(QSslCertificate::LocalityName))); + qDebug("%s", qPrintable(_socket->peerCertificate().subjectInfo(QSslCertificate::OrganizationalUnitName))); + qDebug("%s", qPrintable(_socket->peerCertificate().subjectInfo(QSslCertificate::CountryName))); + qDebug("%s", qPrintable(_socket->peerCertificate().subjectInfo(QSslCertificate::StateOrProvinceName))); } if (cert == _fingerprint && !_validated) { _validated = true; emit validated(this); - printf("Validated certificate of %s :)\n", _socket->peerAddress().toString().toUtf8().data()); + qDebug("Validated certificate of %s :)", qPrintable(_socket->peerAddress().toString())); } else { - printf("Certificate of %s is invalid :(\n", _socket->peerAddress().toString().toUtf8().data()); + qDebug("Certificate of %s is invalid :(", qPrintable(_socket->peerAddress().toString())); QByteArray is, should; is = cert.toBase64(); should = _fingerprint.toBase64(); - printf("Is %s and should be %s\n", is.data(), should.data()); + qDebug("Is %s and should be %s", is.data(), should.data()); } _socket->disconnectFromHost(); } diff --git a/src/net/pvsListenServer.cpp b/src/net/pvsListenServer.cpp index f21303e..58d4aee 100644 --- a/src/net/pvsListenServer.cpp +++ b/src/net/pvsListenServer.cpp @@ -137,7 +137,7 @@ void PVSListenServer::timerEvent(QTimerEvent *event) } if (client->lastData() < refval) { // ping timeout - printf("Ping timeout for client %s\n", client->getNameUser().toLocal8Bit().data()); + qDebug("Ping timeout for client %s", qPrintable(client->getNameUser())); if (disconnectClient(client)) break; // list was modified, iterator not valid anymore } @@ -283,9 +283,8 @@ void PVSListenServer::server_connectionRequest() void PVSListenServer::handleClientMsg(unsigned int clientID, PVSMsg msg) { - printf("Got Message for client %ud: [%c][%s][%s]\n", clientID, - (char) msg.getType(), msg.getIdent().toUtf8().data(), - msg.getMessage().toUtf8().data()); + qDebug("Got Message for client %ud: [%c][%s][%s]", clientID, + (char) msg.getType(), qPrintable(msg.getIdent()), qPrintable(msg.getMessage())); msg.setSndID(clientID); if (msg.getType() == PVSCOMMAND) _commandDispatcher.fire(msg.getIdent(), msg); diff --git a/src/net/pvsListenServer.h b/src/net/pvsListenServer.h index ab021c7..b43b730 100644 --- a/src/net/pvsListenServer.h +++ b/src/net/pvsListenServer.h @@ -73,7 +73,7 @@ public: template void addLoginHandler(QString ident, T* who, void (T :: *func)(PVSMsg)) { - printf("Listener got added to LoginHandler\n"); + qDebug("Listener got added to LoginHandler"); _loginDispatcher.addListener(ident, who, func); }; template void removeLoginHandler(QString ident, T* who, void (T :: *func)(PVSMsg)) diff --git a/src/net/pvsLocalhostCommunicator.cpp b/src/net/pvsLocalhostCommunicator.cpp index 199b39c..20783bb 100644 --- a/src/net/pvsLocalhostCommunicator.cpp +++ b/src/net/pvsLocalhostCommunicator.cpp @@ -83,7 +83,7 @@ void PVSLocalhostCommunicator::sendCommand(QString ident, QString cmd) int len; sender.getBinaryData(data, len); QByteArray qba(data, len); - printf("Sending %d bytes to daemon...\n", qba.length()); + qDebug("Sending %d bytes to daemon...", qba.length()); qint64 result = _sock->writeDatagram(qba, localhost, localport); _sock->waitForBytesWritten(100); @@ -92,11 +92,11 @@ void PVSLocalhostCommunicator::sendCommand(QString ident, QString cmd) { if (result == -1) { - printf("Error sending PVSMsg to daemon: %s\n", _sock->errorString().toUtf8().data()); + qDebug("Error sending PVSMsg to daemon: %s", qPrintable(_sock->errorString())); } else { - printf("Sent PVSMsg was incomplete.\n"); + qDebug("Sent PVSMsg was incomplete."); } stop(); } diff --git a/src/net/pvsServerConnection.cpp b/src/net/pvsServerConnection.cpp index 04a1ef6..d187ce3 100644 --- a/src/net/pvsServerConnection.cpp +++ b/src/net/pvsServerConnection.cpp @@ -70,7 +70,7 @@ void PVSServerConnection::sslErrors ( const QList & errors ) for (QList::const_iterator it = errors.begin(); it != errors.end(); it++) { QSslError err = *it; - printf("Connect SSL: %s\n", err.errorString().toUtf8().data()); + qDebug("Connect SSL: %s", qPrintable(err.errorString())); if (err.error() == QSslError::HostNameMismatch) continue; // We don't pay attention to hostnames for validation if (err.error() == QSslError::SelfSignedCertificate) continue; // Also, this will always be the case; we check the fingerprint later ConsoleLog writeNetwork(err.errorString().toUtf8().data()); diff --git a/src/net/pvsServiceDiscovery.cpp b/src/net/pvsServiceDiscovery.cpp index 0a99802..dd6b500 100644 --- a/src/net/pvsServiceDiscovery.cpp +++ b/src/net/pvsServiceDiscovery.cpp @@ -30,7 +30,7 @@ PVSServiceDiscovery::PVSServiceDiscovery(PVS* client) bool ret = _sock.bind(SD_PORT_CLIENT); if (!ret) { - printf("Could not open SERVICE DISCOVERY port\n"); + qDebug("Could not open SERVICE DISCOVERY port"); exit(1); } connect(&_sock, SIGNAL(readyRead()), this, SLOT(sock_dataArrival())); diff --git a/src/pvs.cpp b/src/pvs.cpp index 07b9005..2aaec8a 100755 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -54,9 +54,9 @@ PVS::PVS() : new PvsAdaptor(this); QDBusConnection dbus = QDBusConnection::sessionBus(); if (!dbus.registerObject("/", this)) - printf("[ERROR] DBus: Could not register object\n"); + qDebug("[ERROR] DBus: Could not register object"); if (!dbus.registerService("org.openslx.pvs")) - printf("[ERROR] DBus: Could not register service\n"); + qDebug("[ERROR] DBus: Could not register service"); _sdClient = new PVSServiceDiscovery(this); diff --git a/src/pvsDaemon.cpp b/src/pvsDaemon.cpp index 4d3e146..cc11bd4 100755 --- a/src/pvsDaemon.cpp +++ b/src/pvsDaemon.cpp @@ -13,8 +13,8 @@ QTextStream qout(stdout); /// VERSION_STRING is defined in src/version.h void printVersion(bool doExit) { - QTextStream qout(stdout); - printf("Version:\t"VERSION_STRING"\n"); + qout << "Version:\t"VERSION_STRING"\n"; + qout.flush(); if (doExit) exit(0); } @@ -36,7 +36,7 @@ void printHelp() qout << QObject::tr("-v or --version") << "\n\t" << QObject::tr("Shows the current version and exits.") << "\n"; qout << QObject::tr("-d or --daemon") << "\n\t" << QObject::tr("Start as daemon.") << "\n"; qout << QObject::tr("-c :") << "\n\t" << QObject::tr("Sends the command and the optional value to a running PVS-Client.") << "\n\t" << QObject::tr("Command and value may not contain spaces or colons.") << "\n\t" << QObject::tr("The dividing colon is mandatory.") << "\n"; - qout << "-commands: \n\t" << QObject::tr("Prints out available commands to use with -c.") << "\n"; + qout << "--commands: \n\t" << QObject::tr("Prints out available commands to use with -c.") << "\n"; qout << "**************************************************************\n"; qout.flush(); exit(0); @@ -51,11 +51,10 @@ void printNotice() void printCommands() { - printf("**************************************************************\n"); - printf("chat:\n "); - printf("on = turns that chat option on\n off = turns the chat option off\n 1 = bossmode\n 2 = community\n 3 = private\n"); - printf("stop \n\t Stops the running PVS-Client.\n"); - printf("**************************************************************\n"); + qout << "**************************************************************\n"; + qout << "stop \n\t Stops the running PVS-Client.\n"; + qout << "**************************************************************\n"; + qout.flush(); exit(0); } @@ -102,7 +101,7 @@ int main(int argc, char** argv) com.run(); if (!(com.running())) { - printf("Error. UDS Communicator is not running. Exiting.\n"); + qDebug("Error. UDS Communicator is not running. Exiting."); exit(0); } @@ -151,20 +150,20 @@ int main(int argc, char** argv) if (com.server()) { // wont work, no daemon running - printf("Error. No running PVS-Client found. Exiting.\n"); + qDebug("Error. No running PVS-Client found. Exiting."); com.stop(); } else { - printf("Will send i: %s, m: %s\n", argv[option_index + 1], ""); + qDebug("Will send i: %s, m: %s\n", argv[option_index + 1], ""); com.sendCommand(QString(argv[option_index + 1]), ""); QCoreApplication::processEvents(QEventLoop::AllEvents); - printf("Sent command. Exiting.\n"); + qDebug("Sent command. Exiting."); } } else { - printf("Error. No command issued. Exiting.\n"); + qDebug("Error. No command issued. Exiting."); } exit(0); // and gone } @@ -211,7 +210,7 @@ int main(int argc, char** argv) { if (option_index + 1 < argc) { - printf("WARNING: -e is deprecated\n"); + qDebug("WARNING: -e is deprecated"); option_index++; continue; } @@ -243,7 +242,7 @@ int main(int argc, char** argv) if (!com.server()) { - printf("Error. PoolVSClient already running. Exiting\n"); + qDebug("Error. PoolVSClient already running. Exiting"); com.stop(); exit(0); } diff --git a/src/util/consoleLogger.cpp b/src/util/consoleLogger.cpp index 5d07dbe..9189543 100755 --- a/src/util/consoleLogger.cpp +++ b/src/util/consoleLogger.cpp @@ -235,7 +235,7 @@ void ConsoleLogger::_prepareLog() if (_logFile.good()) _logFileGood = true; else - printf("ERROR: Logfile ( %s ) not accessible/found. Logs will not be available.\n", _logPath.toUtf8().data()); + qDebug("ERROR: Logfile ( %s ) not accessible/found. Logs will not be available.", qPrintable(_logPath)); _logFile.close(); } diff --git a/src/util/consoleLogger.h b/src/util/consoleLogger.h index 3a0950d..e4cb291 100644 --- a/src/util/consoleLogger.h +++ b/src/util/consoleLogger.h @@ -116,7 +116,7 @@ public: _line.push_back('\n'); // add an explicit newline char, so it looks better in the logfile //#ifndef as_daemon if (_level == LOG_TERMINAL) // may look strange here, but its quite central :-) - printf("%s\n", _line.toUtf8().data()); + qDebug("%s", qPrintable(_line)); //#endif }; LOG_LEVEL getLevel() diff --git a/src/util/util.cpp b/src/util/util.cpp index 8b25b12..05a209f 100755 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -213,7 +213,7 @@ QString getUserName() #endif //#ifdef __WIN32__ if (username.isEmpty()) { - printf("USERNAME COULDNT BE RETRIEVED!\n"); + qDebug("USERNAME COULDNT BE RETRIEVED!"); username = QString("USERNAMEERROR"); } return username; @@ -323,7 +323,7 @@ QString readPassFromPassFile() } bool getAllowed() { - printf("Checking %s\n", getPolicyFilePath(QString(".allow")).toUtf8().data()); + qDebug("Checking %s", qPrintable(getPolicyFilePath(QString(".allow")))); TextFile file(getPolicyFilePath(".allow")); if (file.good()) // should have been checked via exists before, but better be safe { @@ -338,7 +338,7 @@ bool getAllowed() (allowed.compare(QString("TRUE")) == 0) ) return true; } - printf("...negative\n"); + qDebug("...negative"); return false; } -- cgit v1.2.3-55-g7522