diff options
author | Johann Latocha | 2011-03-02 02:08:42 +0100 |
---|---|---|
committer | Johann Latocha | 2011-03-02 02:08:42 +0100 |
commit | 3b7320ef4e2bd9f24b6dce72a8e8bf94c3695796 (patch) | |
tree | 99fdd6aa4c0073e747902486e703e1d738da8369 /src | |
parent | fix cmake paths (diff) | |
download | pvs-3b7320ef4e2bd9f24b6dce72a8e8bf94c3695796.tar.gz pvs-3b7320ef4e2bd9f24b6dce72a8e8bf94c3695796.tar.xz pvs-3b7320ef4e2bd9f24b6dce72a8e8bf94c3695796.zip |
Win32 clean out
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/clientConfigDialog.cpp | 16 | ||||
-rw-r--r-- | src/gui/ui/clientConfigDialog.ui | 30 | ||||
-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 | ||||
-rwxr-xr-x | src/util/clientGUIUtils.h | 2 | ||||
-rwxr-xr-x | src/util/clientGUIUtils_Win32.cpp | 46 | ||||
-rwxr-xr-x | src/util/util.cpp | 50 | ||||
-rwxr-xr-x | src/util/util.h | 9 |
10 files changed, 21 insertions, 188 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/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/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 --- 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/util.cpp b/src/util/util.cpp index 05a209f..0fcfa84 100755 --- 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 --- 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 |