diff options
author | Christian Klinger | 2016-05-20 14:01:03 +0200 |
---|---|---|
committer | Christian Klinger | 2016-05-20 14:01:03 +0200 |
commit | b326ca1dc50f0af3742ba6b5484997738e02976b (patch) | |
tree | 1a211931a27ea1e99870d49893dc41aea9554055 | |
parent | documented tutorIP feature. (diff) | |
download | pvs2-b326ca1dc50f0af3742ba6b5484997738e02976b.tar.gz pvs2-b326ca1dc50f0af3742ba6b5484997738e02976b.tar.xz pvs2-b326ca1dc50f0af3742ba6b5484997738e02976b.zip |
Implemented lock-button feature.
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | gui/client/toolbar.ui | 12 | ||||
-rwxr-xr-x | sample_configuration/lockDesktop.sh | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | sample_configuration/switchBack.sh | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | sample_configuration/switchToManager.sh | 0 | ||||
-rw-r--r-- | src/client/toolbar/toolbar.cpp | 15 | ||||
-rw-r--r-- | src/client/toolbar/toolbar.h | 1 |
7 files changed, 41 insertions, 1 deletions
@@ -16,6 +16,9 @@ A sample configuration can be found in `sample_configuration`. * allowClientQuit: If set to true, users can shut down the client by clicking on "Quit" in the toolbar of pvsclient. +* showLockDesktopButton: If set to true there will be a button "Lock" that when + clicks calls the script "lockDesktop.sh". + #### Room settings A room section represents a physical or virtual room where clients are @@ -69,6 +72,13 @@ To perform the window switching `pvsclient` calls the pair of shell scripts `switchToManager.sh` and `switchBack.sh`. See the sample configuration which uses `wmctrl` to perform the switching. +### Lock-Desktop-Script +To allow users to lock their workstations (and not just the VM) we add a button +"Lock" (when in [general]showLockDesktopButton=true) that when clicked causes +the script /opt/openslx/pvs2/lockDesktop.sh. In this script you should call +something like "xscreensaver-command --lock" or similar. + + ### Network Setup diff --git a/gui/client/toolbar.ui b/gui/client/toolbar.ui index b4ac3b2..cedecad 100644 --- a/gui/client/toolbar.ui +++ b/gui/client/toolbar.ui @@ -6,7 +6,7 @@ <rect> <x>0</x> <y>0</y> - <width>358</width> + <width>503</width> <height>39</height> </rect> </property> @@ -178,6 +178,16 @@ p, li { white-space: pre-wrap; } </widget> </item> <item> + <widget class="QPushButton" name="btnLockDesktop"> + <property name="toolTip"> + <string><html><head/><body><p>Lock this workstation</p></body></html></string> + </property> + <property name="text"> + <string>Lock</string> + </property> + </widget> + </item> + <item> <widget class="QPushButton" name="btnManager"> <property name="text"> <string>Switch</string> diff --git a/sample_configuration/lockDesktop.sh b/sample_configuration/lockDesktop.sh new file mode 100755 index 0000000..0e3c61a --- /dev/null +++ b/sample_configuration/lockDesktop.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# activate a locking scrensaver, xscreensaver, kscreensaver, etc... +xscreensaver-command --lock diff --git a/sample_configuration/switchBack.sh b/sample_configuration/switchBack.sh index cc2bae9..cc2bae9 100644..100755 --- a/sample_configuration/switchBack.sh +++ b/sample_configuration/switchBack.sh diff --git a/sample_configuration/switchToManager.sh b/sample_configuration/switchToManager.sh index 86c6704..86c6704 100644..100755 --- a/sample_configuration/switchToManager.sh +++ b/sample_configuration/switchToManager.sh diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp index 1f98a8b..f620609 100644 --- a/src/client/toolbar/toolbar.cpp +++ b/src/client/toolbar/toolbar.cpp @@ -113,6 +113,14 @@ void Toolbar::init() _ui->btnManager->setVisible(_isManagerPc); connect(_ui->btnManager, SIGNAL(clicked()), this, SLOT(onBtnManager())); + /* setup lock desktop button*/ + SYSTEM_SETTINGS(conf); + bool showLock = conf.value("allowClientQuit").toBool(); + if (showLock) { + connect(_ui->btnLockDesktop, SIGNAL(clicked()), this, SLOT(onBtnLockDesktop())); + } else { + _ui->btnLockDesktop->setVisible(false); + } /* Connect the signals from vnc server */ connect(VncServer::instance(), SIGNAL(started(int, QString&, QString&)), this, SLOT(onVncServerIsRunning(int))); @@ -123,6 +131,7 @@ void Toolbar::init() move(primaryScreen.left() + (primaryScreen.width() - this->width())/2 , primaryScreen.top()); qDebug() << primaryScreen.left() << primaryScreen.top() << primaryScreen.right() << primaryScreen.bottom(); + /* Setup hide timer */ _hideTimer.setInterval(500); _hideTimer.setSingleShot(true); @@ -454,3 +463,9 @@ void Toolbar::onBtnManager() { _onWorkspace2 = !_onWorkspace2; switchP.waitForFinished(); } + +void Toolbar::onBtnLockDesktop() { + QProcess lockP; + lockP.start("/bin/sh", QStringList() << "/opt/openslx/pvs2/lockDesktop.sh"); + lockP.waitForFinished(); +} diff --git a/src/client/toolbar/toolbar.h b/src/client/toolbar/toolbar.h index 0980beb..0e118bf 100644 --- a/src/client/toolbar/toolbar.h +++ b/src/client/toolbar/toolbar.h @@ -67,6 +67,7 @@ private slots: void onConnected(ServerConnection* connection); void onDoDisconnect(); void onBtnManager(); + void onBtnLockDesktop(); void exit(); void cameraBlink(); void showBar(); |