diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/clientConfigDialog.cpp | 16 | ||||
-rw-r--r-- | src/gui/connectionFrame.cpp | 104 | ||||
-rw-r--r-- | src/gui/connectionFrame.h | 16 | ||||
-rw-r--r-- | src/gui/connectionWindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/frame.cpp | 40 | ||||
-rw-r--r-- | src/gui/mainWindow.cpp | 69 | ||||
-rw-r--r-- | src/gui/mainWindow.h | 3 | ||||
-rw-r--r-- | src/gui/ui/clientConfigDialog.ui | 30 | ||||
-rw-r--r-- | src/gui/ui/mainwindowtouch.ui | 6 | ||||
-rw-r--r-- | src/net/mcast/CMakeLists.txt | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | src/pvs.cpp | 22 | ||||
-rw-r--r--[-rwxr-xr-x] | src/pvs.h | 10 | ||||
-rw-r--r-- | src/pvsDaemon.cpp | 23 | ||||
-rw-r--r-- | src/pvsgui.cpp | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | src/util/clientGUIUtils.h | 2 | ||||
-rwxr-xr-x | src/util/clientGUIUtils_Win32.cpp | 46 | ||||
-rw-r--r--[-rwxr-xr-x] | src/util/clientGUIUtils_X11.cpp | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/util/consoleLogger.cpp | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/util/util.cpp | 50 | ||||
-rw-r--r--[-rwxr-xr-x] | src/util/util.h | 9 |
20 files changed, 98 insertions, 353 deletions
diff --git a/src/gui/clientConfigDialog.cpp b/src/gui/clientConfigDialog.cpp index b7ba407..0ddada0 100644 --- a/src/gui/clientConfigDialog.cpp +++ b/src/gui/clientConfigDialog.cpp @@ -96,16 +96,6 @@ void ClientConfigDialog::readSettings() else radioButtonOtherNO->setChecked(true); } - - reply = _ifaceDBus->getConfigValue("Permissions/allow_chat"); - reply.waitForFinished(); - if (reply.isValid()) - checkBoxAllowChat->setChecked(reply.value() == "T"); - - reply = _ifaceDBus->getConfigValue("Permissions/allow_filetransfer"); - reply.waitForFinished(); - if (reply.isValid()) - checkBoxAllowFiletransfer->setChecked(reply.value() == "T"); } void ClientConfigDialog::writeSettings() @@ -125,12 +115,6 @@ void ClientConfigDialog::writeSettings() else _ifaceDBus->setConfigValue("Permissions/vnc_other", "no"); - _ifaceDBus->setConfigValue("Permissions/allow_chat", - QString(checkBoxAllowChat->isChecked() ? "T" : "F")); - _ifaceDBus->setConfigValue("Permissions/allow_filetransfer", - QString(checkBoxAllowFiletransfer->isChecked() ? "T" : "F")); - _ifaceDBus->setConfigValue("multicast/interface", interfaceList->currentText()); - _settings.sync(); emit configChanged(); } diff --git a/src/gui/connectionFrame.cpp b/src/gui/connectionFrame.cpp index b618668..32e20f7 100644 --- a/src/gui/connectionFrame.cpp +++ b/src/gui/connectionFrame.cpp @@ -28,58 +28,31 @@ extern "C" ConnectionFrame::ConnectionFrame(QWidget *parent) : QGroupBox(parent) { - //defines the ui-stuff - - _gL = new QGridLayout(this); - _gL->setSpacing(6); - _gL->setMargin(1); - - _split = new QSplitter(this); - _split->setOrientation(Qt::Vertical); - - _frame = new Frame("", _split); - _frame->setConFrame(this); - _split->addWidget(_frame); - - _conFrameTaskbar = new QWidget(_split); - _conFrameTaskbar->setMaximumHeight(30); - - _gLayout = new QGridLayout(_conFrameTaskbar); - _gLayout->setMargin(0); - _gLayout->setSpacing(0); - - _hLayoutInCfTaskbar = new QHBoxLayout(); - - _ip = new QLabel(_conFrameTaskbar); - _ip->setAlignment(Qt::AlignCenter); - - _hLayoutInCfTaskbar->addWidget(_ip); - - _dozentContaimner = new QLabel(_conFrameTaskbar); - _dozentContaimner->setAlignment(Qt::AlignRight); - _dozentContaimner->setMaximumSize(QSize(20, 20)); - _dozentContaimner->setScaledContents(true); - - _hLayoutInCfTaskbar->addWidget(_dozentContaimner); - - _dozentContaimner->setDisabled(true); - - _status = new QLabel(_conFrameTaskbar); - _status->setAlignment(Qt::AlignRight); - _status->setMaximumSize(QSize(22, 21)); - - _hLayoutInCfTaskbar->addWidget(_status); - - _gLayout->addLayout(_hLayoutInCfTaskbar, 0, 0, 1, 1); - _split->addWidget(_conFrameTaskbar); - - _gL->addWidget(_split, 0, 0, 1, 1); - - this->setLayout(_gL); + _layoutTop = new QVBoxLayout(this); + _layoutTop->setMargin(0); + _frame = new Frame("", this); + _frame->setConFrame(this); + _frame->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); + _layoutTop->addWidget(_frame); + _layoutBottom = new QHBoxLayout(this); + _layoutBottom->setMargin(0); + _conFrameTaskbar = new QWidget(this); + _conFrameTaskbar->setLayout(_layoutBottom); + _conFrameTaskbar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); + _ip = new QLabel(_conFrameTaskbar); + _layoutBottom->addStretch(); + _layoutBottom->addWidget(_ip); + _layoutBottom->addStretch(); + _dozentContaimner = new QLabel(_conFrameTaskbar); + _dozentContaimner->setDisabled(true); + _layoutBottom->addWidget(_dozentContaimner); + _status = new QLabel(_conFrameTaskbar); + _layoutBottom->addWidget(_status); + _layoutTop->addWidget(_conFrameTaskbar); + this->setLayout(_layoutTop); setInitSize(190,168); - initFrame(); nat_height = 0; @@ -176,7 +149,7 @@ void ConnectionFrame::setInitSize(int w, int h) { resize(w, h); _frame->resize(w, h); - _conFrameTaskbar->resize(w, h); + //_conFrameTaskbar->resize(w, h); prev_height = h; prev_width = w; init_w = w; @@ -470,32 +443,11 @@ void ConnectionFrame::mouseMoveEvent(QMouseEvent *event) void ConnectionFrame::paintCloseUp(int w, int h) { - - - if (!_frame->image().isNull()) - { - /*this->setFixedWidth(w); - _conFrameTaskbar->setMaximumWidth(w); - resize(w, h);*/ - resizeComponent(w, h); - setMaximumSize(w,h); - resize(w, h); - } - else - { - std::cout << "pixel is NULL" << std::endl; - } - -} - -void ConnectionFrame::resizeComponent(int w, int h) -{ - int th = (h*_conFrameTaskbar->width())/w; - int uh = (h*_ip->width())/w; - _conFrameTaskbar->setMaximumSize(w, th); - _conFrameTaskbar->resize(w, th); - _ip->setMaximumSize(w, uh); - _ip->resize(w,uh); + if (!_frame->image().isNull()) + { + //move(0,0); + resize(w, h); + } } void ConnectionFrame::setSource() diff --git a/src/gui/connectionFrame.h b/src/gui/connectionFrame.h index 235d0fc..fe6dc95 100644 --- a/src/gui/connectionFrame.h +++ b/src/gui/connectionFrame.h @@ -16,8 +16,8 @@ extern "C" } #define PROFILE -#define STYLE_DEFAULT "QGroupBox{background-color: rgb(150, 150, 150); margin: 2px; border: 1px solid black; border-radius: 8px; padding: 2px; padding-top: 1.5em;}" -#define STYLE_SELECTED "QGroupBox{background-color: rgb(150, 150, 150); margin: 2px; border: 1px solid red; border-radius: 8px; padding: 2px; padding-top: 1.5em;}" +#define STYLE_DEFAULT "QGroupBox{background-color: #DCDCDC; margin: 2px; border: 1px solid black; border-radius: 8px; padding: 2px; padding-top: 1.5em;}" +#define STYLE_SELECTED "QGroupBox{background-color: #DCDCDC; margin: 2px; border: 1px solid red; border-radius: 8px; padding: 2px; padding-top: 1.5em;}" #include <src/util/timeUtil.h> @@ -118,7 +118,6 @@ public: void setFrameRate(int newRate); bool isClientOnline; void paintCloseUp(int w, int h); - void resizeComponent(int w, int h); void setSource(); void setTarget(); void setUnproject(); @@ -145,8 +144,8 @@ public Q_SLOTS: protected: //virtual void paintEvent(QPaintEvent *event); void mouseReleaseEvent ( QMouseEvent * e ); - virtual void enterEvent ( QEvent * event ); - virtual void leaveEvent ( QEvent * event ); + virtual void enterEvent ( QEvent * event ); + virtual void leaveEvent ( QEvent * event ); void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); //void mouseReleaseEvent ( QMouseEvent * event ); @@ -154,15 +153,12 @@ protected: private: Frame *_frame; - //clickableLabel *frame; - QSplitter *_split; - QGridLayout* _gL; + QVBoxLayout *_layoutTop; + QHBoxLayout *_layoutBottom; QLabel* _ip; QLabel* _status; QLabel* _dozentContaimner; QWidget* _conFrameTaskbar; - QGridLayout* _gLayout; - QHBoxLayout* _hLayoutInCfTaskbar; PVSClient* _myConnection; QPixmap _clientPix; diff --git a/src/gui/connectionWindow.cpp b/src/gui/connectionWindow.cpp index df31562..ec6db1b 100644 --- a/src/gui/connectionWindow.cpp +++ b/src/gui/connectionWindow.cpp @@ -38,6 +38,8 @@ ConnectionWindow::ConnectionWindow(QWidget *parent) : menu->addAction(newDummy); setAcceptDrops(true); //drag&drop should be enabled + + setStyleSheet("background-color: #DCDCDC;"); } ConnectionWindow::~ConnectionWindow() { diff --git a/src/gui/frame.cpp b/src/gui/frame.cpp index aa6b0cb..6054065 100644 --- a/src/gui/frame.cpp +++ b/src/gui/frame.cpp @@ -36,13 +36,10 @@ Frame::Frame(const QString & text, QWidget * parent) : Y = 0; setBackgroundRole(QPalette::Base); - setStyleSheet(QString::fromUtf8("QLabel{border-radius:10px;\n" - "background-color: rgb(150,150,150);}")); - - setAlignment(Qt::AlignCenter); + setAlignment(Qt::AlignCenter); setAutoFillBackground(true); - setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); + setFrameStyle(QFrame::StyledPanel | QFrame::Plain); _isLocked = false; _dozent = false; @@ -51,12 +48,13 @@ Frame::Frame(const QString & text, QWidget * parent) : //QIcon icon; //icon.addFile(QString::fromUtf8(), QSize(), QIcon::Normal, QIcon::Off); - button_closeUp = createToolButton(tr("View"), QIcon(":/restore"),SLOT(closeUp())); - button_closeUp->setCheckable(true); - button_foto = createToolButton(tr("Foto"), QIcon(":/photos"),SLOT(foto())); - button_lock = createToolButton(tr("Lock this client"), QIcon(":/lock"),SLOT(setLock())); +// button_closeUp = createToolButton(tr("View"), QIcon(":/restore"),SLOT(closeUp())); +// button_closeUp->setCheckable(true); +// button_foto = createToolButton(tr("Foto"), QIcon(":/photos"),SLOT(foto())); +// button_lock = createToolButton(tr("Lock this client"), QIcon(":/lock"),SLOT(setLock())); //button_unlock = createToolButton(tr("Unlock this client"), QIcon(":/lock"),SLOT(setLock())); - button_dozent = createToolButton(tr("Set as Superclient"), QIcon(":/dozent2"),SLOT(setDozent())); +// button_dozent = createToolButton(tr("Set as Superclient"), QIcon(":/dozent2"),SLOT(setDozent())); +// button_dozent->setCheckable(true); button_control = createToolButton(tr("Enable Remote Control"), QIcon(":/remotecontrol"), SLOT(remoteControlClicked())); button_control->setCheckable(true); button_control_all = createToolButton(tr("Remote Control All Clients"), QIcon(":/remotecontrolall"), SLOT(remoteControlAllClicked())); @@ -292,27 +290,25 @@ QToolButton* Frame::createToolButton(const QString &toolTip, const QIcon &icon, QToolButton *button = new QToolButton(this); button->setToolTip(toolTip); button->setIcon(icon); - button->setIconSize(QSize(15, 15)); - button->setStyleSheet(QString::fromUtf8("background-color: rgb(230, 230, 230);")); + button->setIconSize(QSize(30, 30)); addButton(button); toolButtonList.append(button); connect(button, SIGNAL(clicked()), this, member); - return button; } void Frame::addButton(QToolButton *button) { button->move(X,Y); - Y += button->size().height()-5; + Y += button->size().height() + 10; } void Frame::setToolButtonListVisible(bool visible) { foreach (QToolButton* tb, toolButtonList) tb->setVisible(visible); - if (visible && MainWindow::getConnectionWindow()->hasDozent && !_dozent) - button_dozent->setVisible(false);//At this time this button should only be visible on the dozent machine (the superclient). +// if (visible && MainWindow::getConnectionWindow()->hasDozent && !_dozent) +// button_dozent->setVisible(false);//At this time this button should only be visible on the dozent machine (the superclient). } @@ -320,12 +316,12 @@ void Frame::setLockStatus(bool lock) { if (lock) { - button_lock->setToolTip(tr("Unlock this client")); + //button_lock->setToolTip(tr("Unlock this client")); //button_lock->setIcon() TODO } else { - button_lock->setToolTip(tr("Lock this client")); + //button_lock->setToolTip(tr("Lock this client")); //button_lock->setIcon() TODO } _isLocked = lock; @@ -373,14 +369,14 @@ void Frame::setDozent() { if (_dozent) { - button_dozent->setToolTip(tr("Set client as Superclient")); + //button_dozent->setToolTip(tr("Set client as Superclient")); _dozent = false; MainWindow::getConnectionWindow()->hasDozent = false; getConFrame()->setDozent(false); } else { - button_dozent->setToolTip(tr("Unset client as Superclient")); + //button_dozent->setToolTip(tr("Unset client as Superclient")); _dozent = true; MainWindow::getConnectionWindow()->hasDozent = true; getConFrame()->setDozent(true); @@ -390,7 +386,7 @@ void Frame::setDozent() void Frame::setCloseUp(bool value) { _isCloseUp = value; - button_closeUp->setChecked(value); + //button_closeUp->setChecked(value); } void Frame::remoteControlClicked() @@ -503,6 +499,7 @@ void Frame::updateMousePosition(QMouseEvent* event) void Frame::enterEvent(QEvent* event) { + QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); _mouseOver = true; if(_remoteControlEnabled) { @@ -512,6 +509,7 @@ void Frame::enterEvent(QEvent* event) void Frame::leaveEvent(QEvent* event) { + QApplication::setOverrideCursor(QCursor(Qt::OpenHandCursor)); _mouseOver = false; if(_remoteControlEnabled) { diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp index 6bb84a4..4eae44e 100644 --- a/src/gui/mainWindow.cpp +++ b/src/gui/mainWindow.cpp @@ -47,8 +47,6 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : { ui->setupUi(this); - _info = new QLabel(""); - if (!QFile::exists(_settings.fileName())) { QDir::root().mkpath(QFileInfo(_settings.fileName()).path()); @@ -131,6 +129,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : qualityActionGroup->addAction(ui->action_quality_Low); // define the slots we want to use + connect(ui->action_Info, SIGNAL(triggered()), this, SLOT(info())); connect(ui->action_Quit, SIGNAL(triggered()), this, SLOT(close())); connect(ui->action_Manage_Profiles, SIGNAL(triggered()), this, SLOT(createProfile())); connect(ui->action_Reset, SIGNAL(triggered()), this, SLOT(resetall())); @@ -200,8 +199,6 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : connect(ui->action_quality_Low, SIGNAL(triggered()), qualitySignalMapper, SLOT (map())); connect(qualitySignalMapper, SIGNAL(mapped(int)), this, SLOT(setVNCQuality(int))); - ui->toolBar->addWidget(_info); - #else // toolbar and actions in pvsmgr connect(ui->action_Exit, SIGNAL(triggered()), this, SLOT(close())); @@ -361,7 +358,7 @@ void MainWindow::loadSettings() title.append(" [" + _sessionName + " : "); title.append(_pwdCon + "]"); setWindowTitle(title); - _info->setText(title); + _info = title; } else { @@ -370,7 +367,7 @@ void MainWindow::loadSettings() title.append(" [" + _sessionName + " : "); title.append(_pwdCon + "]"); setWindowTitle(title); - _info->setText(title); + _info = title; settings.beginGroup(current); QStringList keys = settings.childKeys(); for (int i = 0; i < keys.size(); i++) @@ -446,7 +443,7 @@ void MainWindow::loadSettings(QString profilname) // loads the current profile title.append(" [" + _sessionName + " : "); title.append(_pwdCon + "]"); setWindowTitle(title); - _info->setText(title); + _info = title; } } @@ -648,47 +645,8 @@ void MainWindow::changeEvent(QEvent *e) */ void MainWindow::resizeEvent(QResizeEvent *event) { - if (bgimage == true) - { repaintbackgroundpicture(); // repaint the backgroundpicture scaled to the window size - } - - if (_firstResize == 3) - { - QSize oldSize = event->oldSize(); - _initW = ui->widget->width(); - _initH = ui->widget->height(); - _firstResize++; - } - std::list<QString>* selectedClients = - MainWindow::getConnectionList()->getSelectedClients(); - if (is_closeup && selectedClients->size() == 1) - { - PVSClient* pvsClient = - PVSConnectionManager::getManager()->getClientFromIp( - selectedClients->front().toStdString().c_str()); - pvsClient->getConnectionFrame()->paintCloseUp(ui->widget->width(), - ui->widget->height()); - } - else if (!is_closeup && _firstResize > 3) - { - int ratio_w = (ui->widget->width() * 100) / _initW; - int ratio_h = (ui->widget->height() * 100) / _initH; -foreach (ConnectionFrame* cf, getConnectionWindow()->getFrameList()) - { - /*int margin = ui->widget->style()->pixelMetric(QStyle::PM_DefaultTopLevelMargin); - int x = ui->widget->width() - margin; - int y = ui->widget->height() - margin; - updatePos(cf, x, y);*/ - int w = (cf->init_w * ratio_w) / 100; - int h = (cf->init_h * ratio_h) / 100; - cf->paintCloseUp(w,h); - } -} - -if (_firstResize < 3) -_firstResize++; } void MainWindow::updatePos(ConnectionFrame* cf, int x, int y) @@ -803,16 +761,10 @@ void MainWindow::closeUp(ConnectionFrame* connFrame, PVSClient* pvsClient) // Do we already have a closeUp Frame? ConnectionFrame* closeupFrame = conWin->getCloseupFrame(); - if(closeupFrame) { - // Is it the same as the sender one? - if(connFrame == closeupFrame) - // Then it already is close up. - return; - else - // We need to un-closeUp the currently selected closeUp-Frame. - unCloseUp(closeupFrame); + unCloseUp(closeupFrame); + return; } _framePosOnCloseUp = connFrame->pos();//get the actualy position before run closeup @@ -1122,7 +1074,7 @@ void MainWindow::setPasswordForConnection(int enabled) title.append(_profilName); title.append(" [" + _sessionName + " : ]"); setWindowTitle(title); - _info->setText(title); + _info = title; } else if (enabled == 2) //password is needed, we show it in the titlebar { @@ -1133,7 +1085,7 @@ void MainWindow::setPasswordForConnection(int enabled) title.append(" [" + _sessionName + " : "); title.append(_pwdCon + "]"); setWindowTitle(title); - _info->setText(title); + _info = title; } } //#endif @@ -1318,6 +1270,11 @@ int MainWindow::getDisplayedClientNameEnum() return displayedClientNameEnum; } +void MainWindow::info() +{ + QMessageBox::information(this, tr("Information"), _info); +} + MainWindow* MainWindow::myself = NULL; ConnectionList* MainWindow::conList = NULL; ConnectionWindow* MainWindow::conWin = NULL; diff --git a/src/gui/mainWindow.h b/src/gui/mainWindow.h index bbe9c49..cf618f0 100644 --- a/src/gui/mainWindow.h +++ b/src/gui/mainWindow.h @@ -123,7 +123,7 @@ private: QString _pwdCon; QString _sessionName; QString _profilName; - QLabel *_info; + QString _info; int displayedClientNameEnum; //to tell if username, loginname or ip is shown in clientList @@ -182,6 +182,7 @@ public slots: void unCloseUp(ConnectionFrame* connFrame); void closeUp(); void foto(); + void info(); void backgroundpicture(); void repaintbackgroundpicture(); void setdozenttoolbar(); diff --git a/src/gui/ui/clientConfigDialog.ui b/src/gui/ui/clientConfigDialog.ui index bb4bdc9..aa73433 100644 --- a/src/gui/ui/clientConfigDialog.ui +++ b/src/gui/ui/clientConfigDialog.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>445</width> - <height>266</height> + <width>366</width> + <height>195</height> </rect> </property> <property name="windowTitle"> @@ -27,7 +27,7 @@ <enum>QTabWidget::North</enum> </property> <property name="currentIndex"> - <number>2</number> + <number>0</number> </property> <widget class="QWidget" name="tabPermissions"> <attribute name="title"> @@ -130,30 +130,6 @@ </property> </widget> </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <widget class="QCheckBox" name="checkBoxAllowChat"> - <property name="text"> - <string>Accept chat messages</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBoxAllowFiletransfer"> - <property name="text"> - <string>Accept file transfers</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> </layout> </widget> <widget class="QWidget" name="tabDisplay"> diff --git a/src/gui/ui/mainwindowtouch.ui b/src/gui/ui/mainwindowtouch.ui index 7241895..651217e 100644 --- a/src/gui/ui/mainwindowtouch.ui +++ b/src/gui/ui/mainwindowtouch.ui @@ -116,6 +116,7 @@ <string>&File</string> </property> <addaction name="separator"/> + <addaction name="action_Info"/> <addaction name="action_Save_Profile"/> <addaction name="action_Manage_Profiles"/> <addaction name="separator"/> @@ -491,6 +492,11 @@ <string>Use Password</string> </property> </action> + <action name="action_Info"> + <property name="text"> + <string>&Info</string> + </property> + </action> </widget> <resources> <include location="../../../pvsmgr.qrc"/> diff --git a/src/net/mcast/CMakeLists.txt b/src/net/mcast/CMakeLists.txt index e92b090..74c8a54 100644 --- a/src/net/mcast/CMakeLists.txt +++ b/src/net/mcast/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE(../../../OpenPGMConfig.cmake) +INCLUDE( OpenPGMConfig ) ADD_DEFINITIONS( ${LIBPGM_CXXFLAGS} diff --git a/src/pvs.cpp b/src/pvs.cpp index 1f751b8..cf45dd7 100755..100644 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -46,9 +46,7 @@ PVS::PVS() : _vncRequested = false; readPolicyFiles(); loadCommands(); - /*#ifndef __WIN32__*/ - _blankScreen = NULL; - /*#endif*/ + _blankScreen = NULL; _vncPort = -1; _masterMcastConfig = new McastConfiguration(this); @@ -81,7 +79,6 @@ PVS::PVS() : _timerLockTest = 0; _timerLockDelay = 0; - #ifndef __WIN32__ //add signalhandling for sigterm signals struct sigaction act; act.sa_handler = &PVS::signalHandler; @@ -95,7 +92,6 @@ PVS::PVS() : sigaction(SIGQUIT, &act, 0); initializeInputEventHandling(); - #endif /*__WIN32__*/ } PVS::~PVS() @@ -593,18 +589,12 @@ int PVS::startVNCScript(int port, QString pass, QString rwpass) if (!system(NULL)) ConsoleLog writeError("No Command processor available"); int result = system(commandLine.toUtf8().data()); - #ifndef __WIN32__ -//TODO Win32 result = WEXITSTATUS(result); if (result != 0) ConsoleLog writeError(QString("VNC-Server is not running, code: ") + int2String(result)); else ConsoleLog writeLine("VNC-Server should be running"); return result; - #else - /*Code fuer VNC-Aufruf unter Windows einfuegen*/ - return 0; - #endif /*__WIN32__*/ } else { @@ -620,7 +610,6 @@ int PVS::stopVNCScript() { if (gotVNCScript()) { - #ifndef __WIN32__ ConsoleLog writeLine("Stopping VNC-Script"); QString commandLine(_vncScriptPath); commandLine.append(" "); @@ -632,10 +621,6 @@ int PVS::stopVNCScript() ConsoleLog writeLine("VNC-Server should be stopped"); int result = system(commandLine.toUtf8().data()); return WEXITSTATUS(result); - #else - /*Code fuer VNC-Server stoppen unter Windows einfuegen*/ - return 0; - #endif /*__WIN32__*/ } else { @@ -713,7 +698,6 @@ QString PVS::getIpByNick(QString nick) void PVS::signalHandler(int signal) { ConsoleLog writeLine(QString("Received Signal ").append (int2String(signal))); - #ifndef __WIN32__ switch (signal) { case SIGHUP: mainClient->quit(); @@ -728,10 +712,6 @@ void PVS::signalHandler(int signal) mainClient->quit(); break; } - #else - ConsoleLog writeLine("Abfang nicht definiert fuer Windows"); - #endif /*__WIN32__*/ - } bool PVS::createMulticastTransfer(QString const& objectPath, quint64& transferID, QString& errorReason) diff --git a/src/pvs.h b/src/pvs.h index 49c2b4c..b2a84cf 100755..100644 --- a/src/pvs.h +++ b/src/pvs.h @@ -13,10 +13,8 @@ #define PVSCLIENT_H_ #include <QtCore> -#ifndef __WIN32__ - #include <X11/Xlib.h> - #include <X11/cursorfont.h> -#endif +#include <X11/Xlib.h> +#include <X11/cursorfont.h> #include <signal.h> #include "setup.h" @@ -141,9 +139,7 @@ private: bool _locked; ///< are we locked? QString _lockMsg; ///< message to display while we're locked bool _vncAllowed; ///< whether vncConnections to this client are allowed (dup?) - /*#ifndef __WIN32__*/ - BlankScreen *_blankScreen;///< object to blank the screen - /*#endif*/ + BlankScreen *_blankScreen;///< object to blank the screen QFileSystemWatcher* _notify; ///< used to get notifies about file changes //vnc-server diff --git a/src/pvsDaemon.cpp b/src/pvsDaemon.cpp index 1784a14..9f2572c 100644 --- a/src/pvsDaemon.cpp +++ b/src/pvsDaemon.cpp @@ -64,9 +64,6 @@ int main(int argc, char** argv) bool _daemon = false; int frequency = 5; int port = -1; -#ifdef as_daemon - bool no_fork = false; -#endif QCoreApplication app(argc, argv); app.setOrganizationName("openslx"); @@ -78,11 +75,6 @@ int main(int argc, char** argv) app.installTranslator(&translator); QFileInfo script; -#ifdef __WIN32__ - //TODO Win32 - if (!script.exists()) - script.setFile(getHomeDir() + "/.pvs/pvs-vncsrv_win32.bat"); -#else QSettings settings; if (!QFile::exists(settings.fileName())) { @@ -97,7 +89,6 @@ int main(int argc, char** argv) script.setFile("/usr/local/bin/pvs-vncsrv"); if (!script.exists()) script.setFile(getHomeDir() + "/.pvs/pvs-vncsrv"); -#endif //__WIN32__ PVSLocalhostCommunicator com(getPolicyFilePath(QString( ".comfile"))); @@ -122,9 +113,6 @@ int main(int argc, char** argv) { "freq", required_argument, 0, 'f' }, { "client", required_argument, 0, 'e' }, { "script", required_argument, 0, 's' }, -#ifdef as_daemon - { "no-fork", no_argument, 0, 'F' }, -#endif { 0, 0, 0, 0 }, }; /* getopt_long stores the option index here. */ @@ -232,13 +220,6 @@ int main(int argc, char** argv) } break; } -#ifdef as_daemon - case 'F': - { - no_fork = true; - break; - } -#endif case '?': { ConsoleLog writeError( @@ -264,11 +245,7 @@ int main(int argc, char** argv) ConsoleLog writeLine(QString("PVS-Client started.")); if (_daemon) - { - #ifndef __WIN32__ daemon(1, 1); - #endif /*__WIN32__*/ - } mainClient = new PVS(); com.getDispatcher()->addListener("*", mainClient, &PVS::onDaemonCommand); diff --git a/src/pvsgui.cpp b/src/pvsgui.cpp index 1f11790..4294206 100644 --- a/src/pvsgui.cpp +++ b/src/pvsgui.cpp @@ -345,7 +345,6 @@ void PVSGUI::disconnected() { statusLabel->setText( "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\"><html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">p, li { white-space: pre-wrap; }</style></head><body style=\" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;\"><p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#ff0000;\">Offline</span></p></body></html>"); - showMessage(tr("PVS connection"), tr("Disconnected")); if (_hosts->contains(hostButton->text())) _hosts->value(hostButton->text())->setChecked(false); hostButton->setText("-"); diff --git a/src/util/clientGUIUtils.h b/src/util/clientGUIUtils.h index 7f7ea47..e797ea0 100755..100644 --- a/src/util/clientGUIUtils.h +++ b/src/util/clientGUIUtils.h @@ -25,7 +25,6 @@ private: BlankScreen_Sysdep* _sysdep; }; -#ifndef __WIN32__ # include <X11/Xlib.h> class X11Info @@ -33,6 +32,5 @@ class X11Info public: static Display* display(); }; -#endif /* !__WIN32__ */ #endif diff --git a/src/util/clientGUIUtils_Win32.cpp b/src/util/clientGUIUtils_Win32.cpp deleted file mode 100755 index 1b4d2ae..0000000 --- a/src/util/clientGUIUtils_Win32.cpp +++ /dev/null @@ -1,46 +0,0 @@ -
-#include "clientGUIUtils.h"
-#include <qwidget.h>
-
-struct BlankScreen_Sysdep {
-
- bool locked;
- QWidget* blankwin;
-
- QString lockMsg;
- int blackColor, whiteColor;
- int offX, offY;
-};
-
-BlankScreen::BlankScreen()
-{
- _sysdep = new BlankScreen_Sysdep;
- _sysdep->blankwin = new QWidget(0, Qt::X11BypassWindowManagerHint | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
- _sysdep->blankwin->setWindowState(Qt::WindowFullScreen);
- _sysdep->blankwin->show();
-}
-
-BlankScreen::~BlankScreen()
-{
- delete _sysdep;
-}
-
-void BlankScreen::draw(bool force)
-{
-
-}
-
-bool BlankScreen::lock()
-{
- return true;
-}
-
-bool BlankScreen::lock_inputs()
-{
- return true;
-}
-
-bool BlankScreen::unlock()
-{
- return true;
-}
diff --git a/src/util/clientGUIUtils_X11.cpp b/src/util/clientGUIUtils_X11.cpp index 4b5afe0..4b5afe0 100755..100644 --- a/src/util/clientGUIUtils_X11.cpp +++ b/src/util/clientGUIUtils_X11.cpp diff --git a/src/util/consoleLogger.cpp b/src/util/consoleLogger.cpp index 9189543..9189543 100755..100644 --- a/src/util/consoleLogger.cpp +++ b/src/util/consoleLogger.cpp diff --git a/src/util/util.cpp b/src/util/util.cpp index 05a209f..0fcfa84 100755..100644 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -7,10 +7,6 @@ #include <QStringList> #include <iostream> #include <QDir> -#ifdef __WIN32__ - #include <windows.h> - #include <Lmcons.h> -#endif //__WIN32__ PVSServerEntry::PVSServerEntry(QString name) { @@ -49,11 +45,7 @@ int getRandom(int min, int max) if (init) { init = false; - #ifndef __WIN32__ srand ( time(NULL) + getpid() ); - #else - srand ( time(NULL) ); /*might be solved by another random factor*/ - #endif } if (min >= max) return rand(); return rand() % (max-min+1) + min; @@ -193,24 +185,10 @@ QString colonSplitter(QString line, bool first) QString getUserName() { QString username; - #ifdef __WIN32__ - WCHAR* lpszSystemInfo; // pointer to system information - DWORD cchBuff = 256; // size of user name - WCHAR tchBuffer[UNLEN + 1]; // buffer for expanded string + struct passwd* passUser = getpwuid(getuid()); + if (passUser) + username = QString(passUser->pw_name); - lpszSystemInfo = tchBuffer; - - // Get and display the user name. - GetUserNameW(lpszSystemInfo, &cchBuff); - - //Unicode string needs to be converted - username = QString::fromWCharArray(lpszSystemInfo); - #else - struct passwd* passUser = getpwuid(getuid()); - if (passUser) - username = QString(passUser->pw_name); - - #endif //#ifdef __WIN32__ if (username.isEmpty()) { qDebug("USERNAME COULDNT BE RETRIEVED!"); @@ -223,21 +201,19 @@ QString getUserName() QString getFullUsername() { QString fullname = getUserName(); - #ifndef __WIN32__ - struct passwd *pd; + struct passwd *pd; - if (NULL == (pd = getpwuid(getuid()))) - {ConsoleLog writeError("getpwuid() error.");} - else + if (NULL == (pd = getpwuid(getuid()))) + {ConsoleLog writeError("getpwuid() error.");} + else + { + QString tmp = pd->pw_gecos; + QStringList userData = tmp.split(","); + if(userData[0].length() > 0 ) { - QString tmp = pd->pw_gecos; - QStringList userData = tmp.split(","); - if(userData[0].length() > 0 ) - { - fullname = userData[0]; - } + fullname = userData[0]; } - #endif //__WIN32__ //might be completed some time to a full solution for WIN32 + } return fullname; } diff --git a/src/util/util.h b/src/util/util.h index 4f2d0ee..0fab33f 100755..100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -1,19 +1,12 @@ #include <QString> #include <cstdio> -//#include <cstring> #include <list> #include <fstream> #include <iostream> -#ifndef __WIN32__ - #include <pwd.h> -#else - /*#include "pwd_win32.h"*/ -#endif /*__WIN32*/ +#include <pwd.h> #include <sys/types.h> #include <sys/stat.h> - - #ifndef _PVSSERVERENTRY_H_ #define _PVSSERVERENTRY_H_ class PVSServerEntry |