From 21db9c9df375452ff84c3d9cce798fc5d78eb53f Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Thu, 8 Jul 2010 18:50:14 +0200 Subject: Building rpms is now supported. On Debian based systems you need the rpm package. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2153497..11650c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -328,7 +328,7 @@ INSTALL( PROGRAMS misc/pvs-vncsrv DESTINATION bin) INSTALL( FILES ${CMAKE_BINARY_DIR}/org.openslx.pvs.service DESTINATION share/dbus-1/services ) # add package target to our makefile -SET( CPACK_GENERATOR "DEB" ) +SET( CPACK_GENERATOR "DEB;RPM" ) SET( CPACK_SET_DESTDIR "ON" ) SET( CPACK_PACKAGE_NAME "pvs" ) SET( CPACK_PACKAGE_VERSION_MAJOR "2" ) -- cgit v1.2.3-55-g7522 From 1219e4b7f14fff9f82e58ef3b243f709e541de68 Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Fri, 16 Jul 2010 17:43:52 +0200 Subject: Compiler optimizations for "Release" changed --- CMakeLists.txt | 4 ++-- 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 | 11 ++++------- 6 files changed, 22 insertions(+), 25 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 11650c2..9570774 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,8 @@ 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 "-O3 -march=native") -# -DQT_NO_DEBUG_OUTPUT") +SET(CMAKE_CXX_FLAGS_RELEASE "-O2") +# -march=native -DQT_NO_DEBUG_OUTPUT") # local cmake modules SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) diff --git a/i18n/pvs_ar_JO.ts b/i18n/pvs_ar_JO.ts index 5cb6fc0..c1b19cb 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 5cb6fc0..c1b19cb 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 5cb6fc0..c1b19cb 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 5cb6fc0..c1b19cb 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 e9a8251..c1b19cb 100644 --- a/i18n/pvs_pl_PL.ts +++ b/i18n/pvs_pl_PL.ts @@ -4,25 +4,22 @@ PVS - + Message - - + VNC connection - - + The host - - + requested your screen! -- cgit v1.2.3-55-g7522 From 19316e9142c5ab4a4e1603715fbbf555aac97826 Mon Sep 17 00:00:00 2001 From: Alexander Hoppe Date: Tue, 3 Aug 2010 18:23:24 +0200 Subject: Anpassungen fuer Win32-build. Aufspaltung der ClientGUIUtils in 2 Versionen Anpassungen des HomeDir Alle Aenderungen sollten unschaedlich fuer den Linux-build-Prozess sein. --- CMakeLists.txt | 100 +++++++++++++++++------ 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 +- src/pvs.cpp | 27 ++++-- src/pvs.h | 11 ++- src/pvsDaemon.cpp | 22 +++-- src/pvsgui.cpp | 2 +- src/util/clientGUIUtils.h | 25 ++---- src/util/clientGUIUtils_Win32.cpp | 46 +++++++++++ src/util/clientGUIUtils_X11.cpp | 168 ++++++++++++++++++++++++++++++++++++++ src/util/consoleLogger.cpp | 2 +- src/util/util.cpp | 62 ++++++++++---- src/util/util.h | 6 +- 16 files changed, 411 insertions(+), 100 deletions(-) mode change 100644 => 100755 CMakeLists.txt mode change 100644 => 100755 src/pvs.cpp mode change 100644 => 100755 src/pvs.h mode change 100644 => 100755 src/pvsDaemon.cpp mode change 100644 => 100755 src/util/clientGUIUtils.h create mode 100755 src/util/clientGUIUtils_Win32.cpp create mode 100755 src/util/clientGUIUtils_X11.cpp mode change 100644 => 100755 src/util/consoleLogger.cpp mode change 100644 => 100755 src/util/util.cpp mode change 100644 => 100755 src/util/util.h (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100644 new mode 100755 index 9570774..d2eae17 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,8 @@ 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 "-O3 -march=native") +# -DQT_NO_DEBUG_OUTPUT") # local cmake modules SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) @@ -31,6 +31,15 @@ INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ) +IF(WIN32) + SET(sysdep_suffix _Win32) + INCLUDE_DIRECTORIES( + /c/KDE4/tmp/LibVNCServer-0.9.7/ + ) +ELSEIF(UNIX) + SET(sysdep_suffix _X11) +ENDIF(WIN32) + ################################################################################ # Variables ################################################################################ @@ -78,7 +87,7 @@ SET( PVS_SRCS src/net/pvsLocalhostCommunicator.cpp src/util/util.cpp src/util/consoleLogger.cpp - src/util/clientGUIUtils.cpp + src/util/clientGUIUtils${sysdep_suffix}.cpp src/util/pvsSettingsManager.cpp src/core/pvsChatClient.cpp src/net/pvsServiceDiscovery.cpp @@ -262,6 +271,7 @@ QT4_CREATE_TRANSLATION( PVSGUI_QMS ${PVSGUI_SRCS} ${PVSGUI_UI_HDRS} ${PVSGUI_TSS ################################################################################ ## here we instruct CMake to build our executable from all of the source files +if(UNIX) ADD_EXECUTABLE( pvsmgr ${PVSMGR_SRCS} ${PVSMGR_MOC_SRCS} @@ -277,6 +287,7 @@ ADD_EXECUTABLE( pvsmgrtouch ${PVSMGR_RC_SRCS} ${PVSMGR_QMS} ) +ENDIF(UNIX) ADD_EXECUTABLE( pvs ${PVS_SRCS} @@ -295,35 +306,72 @@ ADD_EXECUTABLE( pvsgui # last thing we have to do is to tell CMake what libraries our executable needs, # luckily FIND_PACKAGE prepared variables for us: -TARGET_LINK_LIBRARIES( pvsmgr - ${QT_LIBRARIES} - ${VNC_LIBRARIES} - ${X11_LIBRARIES} -) - -TARGET_LINK_LIBRARIES( pvsmgrtouch - ${QT_LIBRARIES} - ${VNC_LIBRARIES} - ${X11_LIBRARIES} -) - -TARGET_LINK_LIBRARIES( pvs - ${QT_LIBRARIES} - ${VNC_LIBRARIES} - ${X11_LIBRARIES} -) - -TARGET_LINK_LIBRARIES( pvsgui - ${QT_LIBRARIES} - ${VNC_LIBRARIES} -) +IF(WIN32) + TARGET_LINK_LIBRARIES( pvsmgr + + ) +ELSEIF(UNIX) +TARGET_LINK_LIBRARIES( pvsmgr + ${QT_LIBRARIES} + ${VNC_LIBRARIES} + ${X11_LIBRARIES} + ) +ENDIF(WIN32) + +IF(WIN32) + TARGET_LINK_LIBRARIES( pvsmgrtouch + + ) +ELSEIF(UNIX) + TARGET_LINK_LIBRARIES( pvsmgrtouch + ${QT_LIBRARIES} + ${VNC_LIBRARIES} + ${X11_LIBRARIES} + ) +ENDIF(WIN32) + +IF(WIN32) + TARGET_LINK_LIBRARIES( pvs + ${QT_LIBRARIES} + ${VNC_LIBRARIES} + advapi32 + ws2_32 + ) +ELSEIF(UNIX) + TARGET_LINK_LIBRARIES( pvs + ${QT_LIBRARIES} + ${VNC_LIBRARIES} + ${X11_LIBRARIES} + ) +ENDIF(WIN32) + +IF(WIN32) + TARGET_LINK_LIBRARIES( pvsgui + ${QT_LIBRARIES} + ${VNC_LIBRARIES} + #advapi32 + ws2_32 + ) +ELSEIF(UNIX) + TARGET_LINK_LIBRARIES( pvsgui + ${QT_LIBRARIES} + ${VNC_LIBRARIES} + ) +ENDIF(WIN32) + +IF(UNIX) SET_PROPERTY(TARGET pvsmgrtouch PROPERTY COMPILE_DEFINITIONS MAINWINDOW_USE_TOUCHGUI) SET_PROPERTY(TARGET pvsmgr PROPERTY COMPILE_DEFINITIONS MAINWINDOW_USE_NORMALGUI) +ENDIF(UNIX) # add install target to our makefile CONFIGURE_FILE( org.openslx.pvs.service ${CMAKE_BINARY_DIR}/org.openslx.pvs.service ) -INSTALL( TARGETS pvsmgr pvs pvsgui pvsmgrtouch RUNTIME DESTINATION bin ) +IF(WIN32) + INSTALL( TARGETS pvs pvsgui RUNTIME DESTINATION bin ) +ELSEIF(UNIX) + INSTALL( TARGETS pvsmgr pvs pvsgui pvsmgrtouch RUNTIME DESTINATION bin ) +ENDIF(WIN32) INSTALL( PROGRAMS misc/pvs-vncsrv DESTINATION bin) INSTALL( FILES ${CMAKE_BINARY_DIR}/org.openslx.pvs.service DESTINATION share/dbus-1/services ) diff --git a/i18n/pvs_ar_JO.ts b/i18n/pvs_ar_JO.ts index c1b19cb..38bf578 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 c1b19cb..38bf578 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 c1b19cb..38bf578 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 c1b19cb..38bf578 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 c1b19cb..38bf578 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/src/pvs.cpp b/src/pvs.cpp old mode 100644 new mode 100755 index d09d407..1c08be5 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -36,12 +36,14 @@ PVS::PVS() : _vncRequested = false; readPolicyFiles(); loadCommands(); - _blankScreen = NULL; + /*#ifndef __WIN32__*/ + _blankScreen = NULL; + /*#endif*/ _vncPort = -1; // add a notify to the allow file, so we get informed when the file is changed - QString watchPath("/home/"); - watchPath.append(getUserName().append(QString("/.pvs/.allow"))); + QString watchPath(getPolicyDir()); + watchPath.append(QString(".allow")); _notify = new QFileSystemWatcher(this); _notify->addPath(QString(watchPath.toUtf8().data())); @@ -64,6 +66,7 @@ PVS::PVS() : _timerLockTest = 0; _timerLockDelay = 0; + #ifndef __WIN32__ //add signalhandling for sigterm signals struct sigaction act; act.sa_handler = &PVS::signalHandler; @@ -75,7 +78,7 @@ PVS::PVS() : sigaction(SIGHUP, &act, 0); sigaction(SIGINT, &act, 0); sigaction(SIGQUIT, &act, 0); - + #endif /*__WIN32__*/ } PVS::~PVS() @@ -498,14 +501,19 @@ int PVS::startVNCScript(int port, QString pass, QString rwpass) commandLine.append(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 { @@ -521,6 +529,7 @@ int PVS::stopVNCScript() { if (gotVNCScript()) { + #ifndef __WIN32__ ConsoleLog writeLine("Stopping VNC-Script"); QString commandLine(_vncScriptPath); commandLine.append(" "); @@ -532,6 +541,10 @@ 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 { @@ -608,6 +621,7 @@ 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(); @@ -622,6 +636,9 @@ void PVS::signalHandler(int signal) mainClient->quit(); break; } + #else + ConsoleLog writeLine("Abfang nicht definiert fuer Windows"); + #endif /*__WIN32__*/ } diff --git a/src/pvs.h b/src/pvs.h old mode 100644 new mode 100755 index ba696d8..b6b5e65 --- a/src/pvs.h +++ b/src/pvs.h @@ -13,8 +13,10 @@ #define PVSCLIENT_H_ #include -#include -#include +#ifndef __WIN32__ + #include + #include +#endif #include #include "setup.h" @@ -25,7 +27,6 @@ #include "src/util/consoleLogger.h" #include "src/util/clientGUIUtils.h" - class PVSServiceDiscovery; class PVSDiscoveredServer; @@ -116,7 +117,9 @@ 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?) - BlankScreen *_blankScreen;///< obhject to blank the screen + /*#ifndef __WIN32__*/ + BlankScreen *_blankScreen;///< object to blank the screen + /*#endif*/ QFileSystemWatcher* _notify; ///< used to get notifies about file changes //vnc-server diff --git a/src/pvsDaemon.cpp b/src/pvsDaemon.cpp old mode 100644 new mode 100755 index e87bfe7..e9479df --- a/src/pvsDaemon.cpp +++ b/src/pvsDaemon.cpp @@ -68,11 +68,17 @@ int main(int argc, char** argv) int port = -1; 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"); + #ifdef __WIN32__ + //TODO Win32 + if (!script.exists()) + script.setFile(getHomeDir() + "/.pvs/pvs-vncsrv_win32.bat"); + #else + script.setFile("/usr/bin/pvs-vncsrv"); + if (!script.exists()) + script.setFile("/usr/local/bin/pvs-vncsrv"); + if (!script.exists()) + script.setFile(getHomeDir() + "/.pvs/pvs-vncsrv"); + #endif //__WIN32__ QCoreApplication app(argc, argv); app.setOrganizationName("openslx"); @@ -293,6 +299,8 @@ int main(int argc, char** argv) #ifdef as_daemon + /*Alex: neu schreiben als pvsdaemon_win32.cpp und minimieren in Task-Leiste*/ + #ifndef __WIN32__ /* Our process ID and Session ID */ pid_t pid, sid; @@ -331,10 +339,10 @@ int main(int argc, char** argv) /* Close out the standard file descriptors */ close(STDIN_FILENO); - freopen ((QString("/home/").append(getUserName().append(QString("/.pvs/dump")))).toUtf8().data(),"w",stdout); + freopen ((QString(getHomeDir()).append(QString("/.pvs/dump"))).toUtf8().data(),"w",stdout); //close(STDOUT_FILENO); close(STDERR_FILENO); - + #endif /*__WIN32__*/ /* Daemon-specific initialization goes here */ /* The Big Loop */ diff --git a/src/pvsgui.cpp b/src/pvsgui.cpp index 6fdd673..b2f0a8f 100644 --- a/src/pvsgui.cpp +++ b/src/pvsgui.cpp @@ -107,7 +107,7 @@ PVSGUI::PVSGUI(QWidget *parent) : connect(_ifaceDBus, SIGNAL(delHost(QString)), this, SLOT(delHost(QString))); // show toolbar - setWindowFlags(Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint); + setWindowFlags(Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint | Qt::FramelessWindowHint); setAttribute(Qt::WA_AlwaysShowToolTips); updateConfig(); setVisible(true); diff --git a/src/util/clientGUIUtils.h b/src/util/clientGUIUtils.h old mode 100644 new mode 100755 index 28b05cc..b04d3fe --- a/src/util/clientGUIUtils.h +++ b/src/util/clientGUIUtils.h @@ -1,21 +1,20 @@ +#ifndef _BLANKSCREEN_H_ +#define _BLANKSCREEN_H_ + #include "src/util/consoleLogger.h" -#include // Every Xlib program must include this -#include #include #include #include - #define REFRESH_RATE 0.15 - -#ifndef _BLANKSCREEN_H_ -#define _BLANKSCREEN_H_ +class BlankScreen_Sysdep; class BlankScreen { public: BlankScreen(); + virtual ~BlankScreen(); void draw(bool force = false); bool lock(); bool unlock(); @@ -23,17 +22,7 @@ public: bool lock_inputs(); private: - Display *dpy; - Window win; - XEvent ev; - int scr; - - bool locked; - - - QString lockMsg; - int blackColor, whiteColor; - int offX, offY; + BlankScreen_Sysdep* _sysdep; }; -#endif +#endif \ No newline at end of file diff --git a/src/util/clientGUIUtils_Win32.cpp b/src/util/clientGUIUtils_Win32.cpp new file mode 100755 index 0000000..1b4d2ae --- /dev/null +++ b/src/util/clientGUIUtils_Win32.cpp @@ -0,0 +1,46 @@ + +#include "clientGUIUtils.h" +#include + +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 new file mode 100755 index 0000000..29c96f0 --- /dev/null +++ b/src/util/clientGUIUtils_X11.cpp @@ -0,0 +1,168 @@ +#include "clientGUIUtils.h" +#include +#include + + +struct BlankScreen_Sysdep { + + Display *dpy; + Window win; + XEvent ev; + int scr; + + bool locked; + + + QString lockMsg; + int blackColor, whiteColor; + int offX, offY; +}; + +BlankScreen::BlankScreen() +{ + _sysdep = new BlankScreen_Sysdep; + _sysdep->dpy = XOpenDisplay(NULL); + _sysdep->scr = DefaultScreen(_sysdep->dpy); + assert(_sysdep->dpy); + _sysdep->blackColor = BlackPixel(_sysdep->dpy, DefaultScreen(_sysdep->dpy)); + _sysdep->whiteColor = WhitePixel(_sysdep->dpy, DefaultScreen(_sysdep->dpy)); +// win = XCreateSimpleWindow(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy), 0, 0, 200, 100, 0, blackColor, whiteColor); + _sysdep->win = XCreateSimpleWindow(_sysdep->dpy, RootWindow(_sysdep->dpy, _sysdep->scr), 10, 10, 200, 200, 1, WhitePixel(_sysdep->dpy, _sysdep->scr), BlackPixel(_sysdep->dpy, _sysdep->scr)); + + XSelectInput(_sysdep->dpy, _sysdep->win, ExposureMask | KeyPressMask); + _sysdep->locked = false; + _sysdep->offX = _sysdep->offY = 0; +} + +BlankScreen::~BlankScreen() +{ + delete _sysdep; +} + +void BlankScreen::draw(bool force) +{ + if (_sysdep->locked)// no need to draw if we're not showing the window + { + XWindowAttributes xwa; + XGetWindowAttributes(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy), &xwa); + int hx = (xwa.width)>>2, hy = (xwa.height)>>2; + + if (XCheckTypedEvent(_sysdep->dpy, Expose, &_sysdep->ev) || force ) + { + hx += _sysdep->offX; + hy += _sysdep->offY; + + GC gcc = XCreateGC(_sysdep->dpy, _sysdep->win, 0, NULL); + XSetForeground(_sysdep->dpy, gcc, _sysdep->whiteColor); +// XClearArea(_sysdep->dpy, _sysdep->win, 0, 0, xwa.width, xwa.height, false); + if (_sysdep->lockMsg.size() > 0) + { + char *msg = const_cast(_sysdep->lockMsg.toUtf8().data()); + XDrawString(_sysdep->dpy, _sysdep->win, gcc/*DefaultGC(dpy, scr)*/, hx, hy, msg, strlen(msg)); + } + else + { + } + } + } +} + +bool BlankScreen::lock() +{ +#define lock_test + + if (_sysdep->locked) + return _sysdep->locked; + + // We want to get MapNotify events + XSelectInput(_sysdep->dpy, _sysdep->win, StructureNotifyMask); + + // "Map" the window (that is, make it appear on the screen) + XMapWindow(_sysdep->dpy, _sysdep->win); + + // Create a "Graphics Context" + //GC gc = XCreateGC(dpy, win, 0, NULL); + + XEvent xev; + Atom wm_state = XInternAtom(_sysdep->dpy, "_NET_WM_STATE", False); + Atom fullscreen = XInternAtom(_sysdep->dpy, "_NET_WM_STATE_FULLSCREEN", False); + memset(&xev, 0, sizeof(xev)); + xev.type = ClientMessage; + xev.xclient.window = _sysdep->win; + xev.xclient.message_type = wm_state; + xev.xclient.format = 32; + xev.xclient.data.l[0] = 1; + xev.xclient.data.l[1] = fullscreen; + xev.xclient.data.l[2] = 0; + + XSendEvent(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy), False, + SubstructureNotifyMask, &xev); + + + + + // Wait for the MapNotify event + for (;;) + { + XEvent e; + XNextEvent(_sysdep->dpy, &e); + if (e.type == MapNotify) + break; + } + //Flush it! + //XFlush(_sysdep->dpy); + +#ifndef lock_test + // load the locked cursor, so people dont think they can click anything + // TODO: Use some kind of invisible cursor instead of the wait-cursor + Cursor _sysdep->locked_cur = XCreateFontCursor(_sysdep->dpy, XC_watch); + XDefineCursor(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy),_sysdep->locked_cur); +#endif + + // grabbing of keyboard and mouse and hide the cursor + XGrabKeyboard(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy), false, GrabModeAsync, GrabModeAsync, CurrentTime); + XGrabPointer(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy), false, 0, GrabModeAsync, GrabModeAsync, None, NULL, CurrentTime); + + if (!_sysdep->locked) + ConsoleLog writeLine(QString("Locked")); + + // see header for more information on this switch + return _sysdep->locked = true; +} + +bool BlankScreen::lock_inputs() +{ + // grabbing of keyboard and mouse and hide the cursor + XGrabKeyboard(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy), false, GrabModeAsync, GrabModeAsync, CurrentTime); + XGrabPointer(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy), false, 0, GrabModeAsync, GrabModeAsync, None, NULL, CurrentTime); + return true; +} + +bool BlankScreen::unlock() +{ + + if (_sysdep->dpy) + { + + int retval = -1; + + //reset cursor to arrow (no *real* default here...) + Cursor normal_cur = XCreateFontCursor(_sysdep->dpy, XC_arrow); + XDefineCursor(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy), normal_cur); + + // ungrabbing of keyboard and mouse + XUngrabPointer(_sysdep->dpy, CurrentTime); + XUngrabKeyboard(_sysdep->dpy, CurrentTime); + + + retval = XUnmapWindow(_sysdep->dpy,_sysdep->win); + if (retval == BadWindow) + ConsoleLog writeError(QString("Bad window while unmapping. Badwindow: ").append(int2String(retval))); + XFlush(_sysdep->dpy); + } + if (_sysdep->locked) + ConsoleLog writeLine(QString("Unlocked")); + + _sysdep->lockMsg.clear(); + return !(_sysdep->locked = false); +} diff --git a/src/util/consoleLogger.cpp b/src/util/consoleLogger.cpp old mode 100644 new mode 100755 index b523b40..ae29989 --- a/src/util/consoleLogger.cpp +++ b/src/util/consoleLogger.cpp @@ -226,7 +226,7 @@ void ConsoleLogger::_prepareLog() _logFileGood = false; _readLog(); - mkdir(getPolicyFilePath(QString()).toUtf8().data(), 0777); + createPolicyDir(); QString fullpath; fullpath.append(_logPath); //TODO: handle wether path/ or path were entered? diff --git a/src/util/util.cpp b/src/util/util.cpp old mode 100644 new mode 100755 index 946168e..7463ae0 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -6,7 +6,11 @@ #include #include #include - +#include +#ifdef __WIN32__ + #include + #include +#endif //__WIN32__ PVSServerEntry::PVSServerEntry(QString name) { @@ -45,7 +49,11 @@ 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; @@ -184,12 +192,29 @@ QString colonSplitter(QString line, bool first) QString getUserName() { - struct passwd* passUser = getpwuid(getuid()); QString username; - if (passUser) - { - username = QString(passUser->pw_name); - } + #ifdef __WIN32__ + WCHAR* lpszSystemInfo; // pointer to system information + DWORD cchBuff = 256; // size of user name + WCHAR tchBuffer[UNLEN + 1]; // buffer for expanded string + + lpszSystemInfo = tchBuffer; + + // Get and display the user name. + GetUserNameW(lpszSystemInfo, &cchBuff); + + //Unicode string needs to be converted + username = QString::fromWCharArray(lpszSystemInfo); + #elif defined __WIN32__ + struct passwd* passUser = getpwuid(getuid()); + + if (passwd) + username = passwd->pw_name; + if (passUser) + { + username = QString(passUser->pw_name); + } + #endif //#ifdef __WIN32__ if (username.isEmpty()) { printf("USERNAME COULDNT BE RETRIEVED!\n"); @@ -202,19 +227,21 @@ QString getUserName() QString getFullUsername() { QString fullname = getUserName(); - struct passwd *pd; + #ifndef __WIN32__ + struct passwd *pd; - if (NULL == (pd = getpwuid(getuid()))) - {ConsoleLog writeError("getpwuid() error.");} - else - { - QString tmp = pd->pw_gecos; - QStringList userData = tmp.split(","); - if(userData[0].length() > 0 ) + if (NULL == (pd = getpwuid(getuid()))) + {ConsoleLog writeError("getpwuid() error.");} + else { - fullname = userData[0]; + QString tmp = pd->pw_gecos; + QStringList userData = tmp.split(","); + if(userData[0].length() > 0 ) + { + fullname = userData[0]; + } } - } + #endif //__WIN32__ //might be completed some time to a full solution for WIN32 return fullname; } @@ -266,7 +293,8 @@ bool policyFileExists(QString fileName) void createPolicyDir() { - mkdir(getPolicyDir().toUtf8().data(), 0777); + QDir(QDesktopServices::storageLocation(QDesktopServices::HomeLocation)).mkdir(".pvs"); + //assuming PolicyDir is defined like in getPolicyDir() } void createPolicyFiles() diff --git a/src/util/util.h b/src/util/util.h old mode 100644 new mode 100755 index 6ddefc6..4f2d0ee --- a/src/util/util.h +++ b/src/util/util.h @@ -4,7 +4,11 @@ #include #include #include -#include +#ifndef __WIN32__ + #include +#else + /*#include "pwd_win32.h"*/ +#endif /*__WIN32*/ #include #include -- cgit v1.2.3-55-g7522 From c544ec75d2314160f5591aab966a77ead26697d7 Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Thu, 26 Aug 2010 22:58:37 +0200 Subject: Some refactoring --- CMakeLists.txt | 4 ++-- src/net/pvsServiceBroadcast.cpp | 10 +++------- src/version.h | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d2eae17..2ac01c9 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,8 @@ 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 "-O3 -march=native") -# -DQT_NO_DEBUG_OUTPUT") +SET(CMAKE_CXX_FLAGS_RELEASE "-O2" ) +#-march=native -DQT_NO_DEBUG_OUTPUT # local cmake modules SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) diff --git a/src/net/pvsServiceBroadcast.cpp b/src/net/pvsServiceBroadcast.cpp index f68db56..46d287d 100644 --- a/src/net/pvsServiceBroadcast.cpp +++ b/src/net/pvsServiceBroadcast.cpp @@ -29,15 +29,11 @@ PVSServiceBroadcast::PVSServiceBroadcast() _timer = 0; _broadcaster.bind(SD_PORT_CONSOLE); - QList interfaces = QNetworkInterface::allInterfaces (); - foreach (QNetworkInterface interface, interfaces) - { - QList entries = interface.addressEntries(); - foreach (QNetworkAddressEntry entry, entries) { + foreach (QNetworkInterface interface, QNetworkInterface::allInterfaces()) + foreach (QNetworkAddressEntry entry, interface.addressEntries()) if (!entry.broadcast().isNull() && entry.broadcast().toString() != "127.255.255.255") _everyone.append(entry.broadcast()); - } - } + if (_everyone.isEmpty()) qDebug("ERROR: No broadcast address found"); } diff --git a/src/version.h b/src/version.h index ac24ac2..69a3bde 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1,2 @@ -#define VERSION_STRING "2.0.1.0" -#define VERSION_NUMBER 2010 +#define VERSION_STRING "2.0.2.0" +#define VERSION_NUMBER 2020 -- cgit v1.2.3-55-g7522 From ca61d21c6defb9553234c1fa5b0979c46542c676 Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Sat, 28 Aug 2010 03:17:08 +0200 Subject: Enhancement #587 --- CMakeLists.txt | 2 +- i18n/pvs_ar_JO.ts | 139 ++++++++++++++++++++++++++++++++++++-- i18n/pvs_de_DE.ts | 141 +++++++++++++++++++++++++++++++++++++-- i18n/pvs_es_MX.ts | 139 ++++++++++++++++++++++++++++++++++++-- i18n/pvs_fr_FR.ts | 139 ++++++++++++++++++++++++++++++++++++-- i18n/pvs_pl_PL.ts | 139 ++++++++++++++++++++++++++++++++++++-- i18n/pvsgui_ar_JO.ts | 66 +++++++++--------- i18n/pvsgui_de_DE.ts | 66 +++++++++--------- i18n/pvsgui_es_MX.ts | 66 +++++++++--------- i18n/pvsgui_fr_FR.ts | 66 +++++++++--------- i18n/pvsgui_pl_PL.ts | 66 +++++++++--------- org.openslx.pvs.service | 2 +- src/gui/clientChatDialog.cpp | 2 - src/gui/clientConfigDialog.cpp | 2 - src/gui/clientFileSendDialog.cpp | 2 - src/gui/clientVNCViewer.cpp | 2 - src/pvs.cpp | 9 ++- src/pvs.h | 2 +- src/pvsDaemon.cpp | 132 ++++++++++++++++-------------------- src/pvsgui.cpp | 34 ++++++---- src/pvsgui.h | 1 - src/version.h | 4 +- 22 files changed, 931 insertions(+), 290 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ac01c9..e364528 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -381,7 +381,7 @@ SET( CPACK_SET_DESTDIR "ON" ) SET( CPACK_PACKAGE_NAME "pvs" ) SET( CPACK_PACKAGE_VERSION_MAJOR "2" ) SET( CPACK_PACKAGE_VERSION_MINOR "0" ) -SET( CPACK_PACKAGE_VERSION_PATCH "1" ) +SET( CPACK_PACKAGE_VERSION_PATCH "3" ) SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Pool Video Switch" ) SET( CPACK_PACKAGE_DESCRIPTION "") SET( CPACK_PACKAGE_CONTACT "Simon Wittenberg " ) diff --git a/i18n/pvs_ar_JO.ts b/i18n/pvs_ar_JO.ts index 38bf578..a57e4bd 100644 --- a/i18n/pvs_ar_JO.ts +++ b/i18n/pvs_ar_JO.ts @@ -4,24 +4,155 @@ PVS - + Message - + VNC connection - + The host - + requested your screen! + + QObject + + + Version: + + + + + Usage: + + + + + <<option> <value>, ... > + + + + + Options: + + + + + -vncScriptFile <fullpath\filename> + + + + + Specifies a custom location for the vnc-start/stop-script. + + + + + If not specified, /usr/bin/pvs-vncsrv is expected. + + + + + -freq <seconds> + + + + + Specifies how long to wait until a reconnection attempt is made. + + + + + Default is 5. + + + + + -port <port> + + + + + Specifies on which port to run. + + + + + Default is + + + + + -h or --help + + + + + Shows this help text and exits. + + + + + -v or --version + + + + + Shows the current version and exits. + + + + + -d or --daemon + + + + + Start as daemon. + + + + + -c <string command>:<string value> + + + + + Sends the command and the optional value to a running PVS-Client. + + + + + Command and value may not contain spaces or colons. + + + + + The dividing colon is mandatory. + + + + + Prints out available commands to use with -c. + + + + + Use -h or --help to get a listing of all options. +-v or --version gives you the current version. + + + + + diff --git a/i18n/pvs_de_DE.ts b/i18n/pvs_de_DE.ts index 38bf578..a58199c 100644 --- a/i18n/pvs_de_DE.ts +++ b/i18n/pvs_de_DE.ts @@ -1,27 +1,158 @@ - + PVS - + Message - + VNC connection - + The host - + requested your screen! + + QObject + + + Version: + + + + + Usage: + + + + + <<option> <value>, ... > + + + + + Options: + + + + + -vncScriptFile <fullpath\filename> + + + + + Specifies a custom location for the vnc-start/stop-script. + + + + + If not specified, /usr/bin/pvs-vncsrv is expected. + + + + + -freq <seconds> + + + + + Specifies how long to wait until a reconnection attempt is made. + + + + + Default is 5. + + + + + -port <port> + + + + + Specifies on which port to run. + + + + + Default is + + + + + -h or --help + + + + + Shows this help text and exits. + + + + + -v or --version + + + + + Shows the current version and exits. + + + + + -d or --daemon + + + + + Start as daemon. + + + + + -c <string command>:<string value> + + + + + Sends the command and the optional value to a running PVS-Client. + + + + + Command and value may not contain spaces or colons. + + + + + The dividing colon is mandatory. + + + + + Prints out available commands to use with -c. + + + + + Use -h or --help to get a listing of all options. +-v or --version gives you the current version. + + + + + diff --git a/i18n/pvs_es_MX.ts b/i18n/pvs_es_MX.ts index 38bf578..a57e4bd 100644 --- a/i18n/pvs_es_MX.ts +++ b/i18n/pvs_es_MX.ts @@ -4,24 +4,155 @@ PVS - + Message - + VNC connection - + The host - + requested your screen! + + QObject + + + Version: + + + + + Usage: + + + + + <<option> <value>, ... > + + + + + Options: + + + + + -vncScriptFile <fullpath\filename> + + + + + Specifies a custom location for the vnc-start/stop-script. + + + + + If not specified, /usr/bin/pvs-vncsrv is expected. + + + + + -freq <seconds> + + + + + Specifies how long to wait until a reconnection attempt is made. + + + + + Default is 5. + + + + + -port <port> + + + + + Specifies on which port to run. + + + + + Default is + + + + + -h or --help + + + + + Shows this help text and exits. + + + + + -v or --version + + + + + Shows the current version and exits. + + + + + -d or --daemon + + + + + Start as daemon. + + + + + -c <string command>:<string value> + + + + + Sends the command and the optional value to a running PVS-Client. + + + + + Command and value may not contain spaces or colons. + + + + + The dividing colon is mandatory. + + + + + Prints out available commands to use with -c. + + + + + Use -h or --help to get a listing of all options. +-v or --version gives you the current version. + + + + + diff --git a/i18n/pvs_fr_FR.ts b/i18n/pvs_fr_FR.ts index 38bf578..a57e4bd 100644 --- a/i18n/pvs_fr_FR.ts +++ b/i18n/pvs_fr_FR.ts @@ -4,24 +4,155 @@ PVS - + Message - + VNC connection - + The host - + requested your screen! + + QObject + + + Version: + + + + + Usage: + + + + + <<option> <value>, ... > + + + + + Options: + + + + + -vncScriptFile <fullpath\filename> + + + + + Specifies a custom location for the vnc-start/stop-script. + + + + + If not specified, /usr/bin/pvs-vncsrv is expected. + + + + + -freq <seconds> + + + + + Specifies how long to wait until a reconnection attempt is made. + + + + + Default is 5. + + + + + -port <port> + + + + + Specifies on which port to run. + + + + + Default is + + + + + -h or --help + + + + + Shows this help text and exits. + + + + + -v or --version + + + + + Shows the current version and exits. + + + + + -d or --daemon + + + + + Start as daemon. + + + + + -c <string command>:<string value> + + + + + Sends the command and the optional value to a running PVS-Client. + + + + + Command and value may not contain spaces or colons. + + + + + The dividing colon is mandatory. + + + + + Prints out available commands to use with -c. + + + + + Use -h or --help to get a listing of all options. +-v or --version gives you the current version. + + + + + diff --git a/i18n/pvs_pl_PL.ts b/i18n/pvs_pl_PL.ts index 38bf578..a57e4bd 100644 --- a/i18n/pvs_pl_PL.ts +++ b/i18n/pvs_pl_PL.ts @@ -4,24 +4,155 @@ PVS - + Message - + VNC connection - + The host - + requested your screen! + + QObject + + + Version: + + + + + Usage: + + + + + <<option> <value>, ... > + + + + + Options: + + + + + -vncScriptFile <fullpath\filename> + + + + + Specifies a custom location for the vnc-start/stop-script. + + + + + If not specified, /usr/bin/pvs-vncsrv is expected. + + + + + -freq <seconds> + + + + + Specifies how long to wait until a reconnection attempt is made. + + + + + Default is 5. + + + + + -port <port> + + + + + Specifies on which port to run. + + + + + Default is + + + + + -h or --help + + + + + Shows this help text and exits. + + + + + -v or --version + + + + + Shows the current version and exits. + + + + + -d or --daemon + + + + + Start as daemon. + + + + + -c <string command>:<string value> + + + + + Sends the command and the optional value to a running PVS-Client. + + + + + Command and value may not contain spaces or colons. + + + + + The dividing colon is mandatory. + + + + + Prints out available commands to use with -c. + + + + + Use -h or --help to get a listing of all options. +-v or --version gives you the current version. + + + + + diff --git a/i18n/pvsgui_ar_JO.ts b/i18n/pvsgui_ar_JO.ts index 04d9717..83560ba 100644 --- a/i18n/pvsgui_ar_JO.ts +++ b/i18n/pvsgui_ar_JO.ts @@ -40,47 +40,47 @@ ClientChatDialog - + &Send File... - + has joined the chat. - + has left the chat. - + PVS File Transfer - + Send file ' - + ' to - + Connected. - + Disconnected. - + Message from < @@ -260,23 +260,23 @@ ClientFileSendDialog - + Open File - - + + PVS - File Transfer - + File Transfer complete. - + File Transfer canceled! @@ -399,77 +399,77 @@ p, li { white-space: pre-wrap; } - + &Disconnect - + C&hat - + &Send File - + &Config - + &Information - + &About - + &Quit - - - + + + PVS Connection - + Please enter password (If not needed leave blank): - + Are you sure you want to disconnect? - - + + PVS connection - - + + Connected to - - + + Disconnected - + New host available: diff --git a/i18n/pvsgui_de_DE.ts b/i18n/pvsgui_de_DE.ts index 544ebff..d49306a 100644 --- a/i18n/pvsgui_de_DE.ts +++ b/i18n/pvsgui_de_DE.ts @@ -40,47 +40,47 @@ ClientChatDialog - + &Send File... Datei &Senden... - + has joined the chat. ist dem Chat beigetreten. - + has left the chat. hat den Chat verlassen. - + PVS File Transfer PVS Dateiübertragung - + Send file ' Datei senden ' - + ' to ' an - + Connected. Verbunden. - + Disconnected. Getrennt. - + Message from < Nachricht von < @@ -260,23 +260,23 @@ ClientFileSendDialog - + Open File Datei Öffnen - - + + PVS - File Transfer PBS -Dateiübertragung - + File Transfer complete. Dateiübertragung beendet. - + File Transfer canceled! Dateiübertragung abgebrochen! @@ -407,77 +407,77 @@ p, li { white-space: pre-wrap; } Verbinden - + &Disconnect &Trennen - + C&hat - + &Send File Datei &Senden - + &Config &Konfiguration - + &Information &Information - + &About &Über - + &Quit &Beenden - - - + + + PVS Connection PVS Verbindung - + Please enter password (If not needed leave blank): Bitte geben sie ein Passwor ein (Falls nicht erforderlich einfach leer lassen): - + Are you sure you want to disconnect? Sind sie sicher dass sie die Verbindung trennen möchten? - - + + PVS connection PVS Verbindung - - + + Connected to Verbunden mit - - + + Disconnected Getrennt - + New host available: Neuer Host verfügbar: diff --git a/i18n/pvsgui_es_MX.ts b/i18n/pvsgui_es_MX.ts index 855ee9b..92db9d7 100644 --- a/i18n/pvsgui_es_MX.ts +++ b/i18n/pvsgui_es_MX.ts @@ -40,47 +40,47 @@ ClientChatDialog - + &Send File... Enviar archivo... - + has joined the chat. ha ingresado al chat. - + has left the chat. ha abandonado el chat - + PVS File Transfer PVS Transferencia de datos - + Send file ' Enviar archivo ' - + ' to ' a - + Connected. Conectado. - + Disconnected. Desconectado. - + Message from < Mensaje de < @@ -260,23 +260,23 @@ ClientFileSendDialog - + Open File Abrir archivo - - + + PVS - File Transfer PVS - Transferencia de datos - + File Transfer complete. La transferencia de datos ha sido completada. - + File Transfer canceled! La transferencia de datos ha sido cancelada! @@ -419,77 +419,77 @@ p, li { white-space: pre-wrap; } Conectar - + &Disconnect &Desconectar - + C&hat ??? - + &Send File &Enviar archivo - + &Config &Configuración - + &Information &Información - + &About &Acerca de - + &Quit &Cerrar - - - + + + PVS Connection PVS Connección - + Please enter password (If not needed leave blank): Porfavor ingrese una contraseña (Deje la seccion vacia si no lo necesita): - + Are you sure you want to disconnect? Realmente desea desconectarse? - - + + PVS connection PVS Connección - - + + Connected to Connectar a - - + + Disconnected Desconectado - + New host available: Nuevo Host disponible: diff --git a/i18n/pvsgui_fr_FR.ts b/i18n/pvsgui_fr_FR.ts index 04d9717..83560ba 100644 --- a/i18n/pvsgui_fr_FR.ts +++ b/i18n/pvsgui_fr_FR.ts @@ -40,47 +40,47 @@ ClientChatDialog - + &Send File... - + has joined the chat. - + has left the chat. - + PVS File Transfer - + Send file ' - + ' to - + Connected. - + Disconnected. - + Message from < @@ -260,23 +260,23 @@ ClientFileSendDialog - + Open File - - + + PVS - File Transfer - + File Transfer complete. - + File Transfer canceled! @@ -399,77 +399,77 @@ p, li { white-space: pre-wrap; } - + &Disconnect - + C&hat - + &Send File - + &Config - + &Information - + &About - + &Quit - - - + + + PVS Connection - + Please enter password (If not needed leave blank): - + Are you sure you want to disconnect? - - + + PVS connection - - + + Connected to - - + + Disconnected - + New host available: diff --git a/i18n/pvsgui_pl_PL.ts b/i18n/pvsgui_pl_PL.ts index 04d9717..83560ba 100644 --- a/i18n/pvsgui_pl_PL.ts +++ b/i18n/pvsgui_pl_PL.ts @@ -40,47 +40,47 @@ ClientChatDialog - + &Send File... - + has joined the chat. - + has left the chat. - + PVS File Transfer - + Send file ' - + ' to - + Connected. - + Disconnected. - + Message from < @@ -260,23 +260,23 @@ ClientFileSendDialog - + Open File - - + + PVS - File Transfer - + File Transfer complete. - + File Transfer canceled! @@ -399,77 +399,77 @@ p, li { white-space: pre-wrap; } - + &Disconnect - + C&hat - + &Send File - + &Config - + &Information - + &About - + &Quit - - - + + + PVS Connection - + Please enter password (If not needed leave blank): - + Are you sure you want to disconnect? - - + + PVS connection - - + + Connected to - - + + Disconnected - + New host available: diff --git a/org.openslx.pvs.service b/org.openslx.pvs.service index 0398081..91a3e67 100644 --- a/org.openslx.pvs.service +++ b/org.openslx.pvs.service @@ -1,4 +1,4 @@ [D-BUS Service] Name=org.openslx.pvs -Exec=@CMAKE_INSTALL_PREFIX@/bin/pvs +Exec=@CMAKE_INSTALL_PREFIX@/bin/pvs -d diff --git a/src/gui/clientChatDialog.cpp b/src/gui/clientChatDialog.cpp index 7c32790..163ac92 100644 --- a/src/gui/clientChatDialog.cpp +++ b/src/gui/clientChatDialog.cpp @@ -29,8 +29,6 @@ ClientChatDialog::ClientChatDialog(QWidget *parent) : // connect to D-Bus and get interface QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/chat", this); - dbus.registerService("org.openslx.pvsgui"); _ifaceDBus = new OrgOpenslxPvsInterface("org.openslx.pvs", "/", dbus, this); connect(_ifaceDBus, SIGNAL(chat_receive(QString, QString, QString)), this, SLOT(receive(QString, QString, QString))); diff --git a/src/gui/clientConfigDialog.cpp b/src/gui/clientConfigDialog.cpp index 3e1ee50..0ee5908 100644 --- a/src/gui/clientConfigDialog.cpp +++ b/src/gui/clientConfigDialog.cpp @@ -28,8 +28,6 @@ ClientConfigDialog::ClientConfigDialog(QWidget *parent) : // connect to D-Bus and get interface QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/config", this); - dbus.registerService("org.openslx.pvsgui"); _ifaceDBus = new OrgOpenslxPvsInterface("org.openslx.pvs", "/", dbus, this); } diff --git a/src/gui/clientFileSendDialog.cpp b/src/gui/clientFileSendDialog.cpp index ccb44b3..b4512c0 100644 --- a/src/gui/clientFileSendDialog.cpp +++ b/src/gui/clientFileSendDialog.cpp @@ -28,8 +28,6 @@ ClientFileSendDialog::ClientFileSendDialog(QWidget *parent) : // connect to D-Bus and get interface QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/filesend", this); - dbus.registerService("org.openslx.pvsgui"); _ifaceDBus = new OrgOpenslxPvsInterface("org.openslx.pvs", "/", dbus, this); // get current users name from backend diff --git a/src/gui/clientVNCViewer.cpp b/src/gui/clientVNCViewer.cpp index d6a218b..d794b0b 100644 --- a/src/gui/clientVNCViewer.cpp +++ b/src/gui/clientVNCViewer.cpp @@ -22,8 +22,6 @@ ClientVNCViewer::ClientVNCViewer(QWidget *parent) : { // connect to D-Bus and get interface QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/vnc", this); - dbus.registerService("org.openslx.pvsgui"); _ifaceDBus = new OrgOpenslxPvsInterface("org.openslx.pvs", "/", dbus, this); connect(_ifaceDBus, SIGNAL(project(QString, int, QString, bool, bool, int)), this, SLOT(open(QString, int, QString, bool, bool, int))); diff --git a/src/pvs.cpp b/src/pvs.cpp index 1c08be5..21b7bdf 100755 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -53,8 +53,10 @@ PVS::PVS() : // connect to D-Bus new PvsAdaptor(this); QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/", this); - dbus.registerService("org.openslx.pvs"); + if (!dbus.registerObject("/", this)) + qDebug("[ERROR] DBus: Could not register object"); + if (!dbus.registerService("org.openslx.pvs")) + qDebug("[ERROR] DBus: Could not register service"); _sdClient = new PVSServiceDiscovery(this); @@ -552,9 +554,10 @@ int PVS::stopVNCScript() } } -void PVS::start() +bool PVS::start() { _pvsServerConnection->sendMessage(PVSMsg(PVSCOMMAND, "PROJECTING", "YES")); + return true; } void PVS::onConnected(QString name) diff --git a/src/pvs.h b/src/pvs.h index b6b5e65..1bb0747 100755 --- a/src/pvs.h +++ b/src/pvs.h @@ -69,7 +69,7 @@ public: void guiDelHost(QString host); public Q_SLOTS: - void start(); + bool start(); void quit(); void chat_send(QString nick_to, QString nick_from, QString msg); QString chat_getNickname(); diff --git a/src/pvsDaemon.cpp b/src/pvsDaemon.cpp index e9479df..b23bc57 100755 --- a/src/pvsDaemon.cpp +++ b/src/pvsDaemon.cpp @@ -9,14 +9,12 @@ #include "src/core/pvsChatClient.h" PVS *mainClient = NULL; - -// This define works as a switch whether to run as deamon or regular app -#define as_daemon +QTextStream qout(stdout); /// VERSION_STRING is defined in src/version.h void printVersion(bool doExit) { - + QTextStream qout(stdout); printf("Version:\t"VERSION_STRING"\n"); if (doExit) exit(0); @@ -25,30 +23,31 @@ void printVersion(bool doExit) /// outputs the full help text void printHelp() { - printf("**************************************************************\n"); - printf("\nPool Video Switch Client\n"); - printf("**************************************************************\n"); - printVersion(false); - printf("**************************************************************\n"); - printf("Usage:\tpoolVSClient <