diff options
author | Christian Klinger | 2016-05-18 13:38:50 +0200 |
---|---|---|
committer | Christian Klinger | 2016-05-18 13:38:50 +0200 |
commit | c0246105ffb770bcc489e9795ea4109bbee0ee61 (patch) | |
tree | 317fd021c3b585794b541ca76e8161d766cf8534 /src/client | |
parent | added sample scripts and README. (diff) | |
download | pvs2-c0246105ffb770bcc489e9795ea4109bbee0ee61.tar.gz pvs2-c0246105ffb770bcc489e9795ea4109bbee0ee61.tar.xz pvs2-c0246105ffb770bcc489e9795ea4109bbee0ee61.zip |
.
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/connectwindow/connectwindow.cpp | 14 | ||||
-rwxr-xr-x | src/client/util/platform/blankscreen.h | 1 | ||||
-rwxr-xr-x | src/client/util/platform/blankscreen_X11.cpp | 12 |
3 files changed, 18 insertions, 9 deletions
diff --git a/src/client/connectwindow/connectwindow.cpp b/src/client/connectwindow/connectwindow.cpp index 578bfa7..5abcaeb 100644 --- a/src/client/connectwindow/connectwindow.cpp +++ b/src/client/connectwindow/connectwindow.cpp @@ -250,16 +250,12 @@ void ConnectWindow::onBtnConnection() * If the list of rooms is empty, switches automatically to the "manual * connection" page */ void ConnectWindow::setAvailableRooms(QList<Room> m) { - if (!m.empty()) { - _ui->comboBox_rooms->clear(); - foreach (Room r, m) { - _ui->comboBox_rooms->addItem(tr("Room ") + r.name, r.mgr); - } - /* also add a pseudo-room "manual choice" */ - _ui->comboBox_rooms->addItem(tr("Session Name..."), "manual_connection"); - } else { - _ui->stackedWidget->setCurrentIndex(1); + _ui->comboBox_rooms->clear(); + foreach (Room r, m) { + _ui->comboBox_rooms->addItem(tr("Room ") + r.name, r.mgr); } + /* also add a pseudo-room "manual choice" */ + _ui->comboBox_rooms->addItem(tr("Session Name..."), "manual_connection"); } /***************************************************************************//** * Handle click on Cancel/Hide Button. diff --git a/src/client/util/platform/blankscreen.h b/src/client/util/platform/blankscreen.h index 8ed4c04..e42043c 100755 --- a/src/client/util/platform/blankscreen.h +++ b/src/client/util/platform/blankscreen.h @@ -3,6 +3,7 @@ #include <QString> #include <QDialog> +#include <QDebug> class BlankScreen_Sysdep; diff --git a/src/client/util/platform/blankscreen_X11.cpp b/src/client/util/platform/blankscreen_X11.cpp index 69b6d8c..cee8f03 100755 --- a/src/client/util/platform/blankscreen_X11.cpp +++ b/src/client/util/platform/blankscreen_X11.cpp @@ -1,6 +1,8 @@ + #include "blankscreen.h" #include <QApplication> +#include <QProcess> #include <QDesktopWidget> #include <X11/Xlib.h> @@ -52,6 +54,11 @@ bool BlankScreen::lock(const QString& message) XGrabKeyboard(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy) , false, GrabModeAsync, GrabModeAsync, CurrentTime); XGrabPointer(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy) , false, 0, GrabModeAsync, GrabModeAsync, None, 0, CurrentTime); + + QProcess ungrabP; + ungrabP.start("/bin/bash", QStringList() << "/opt/openslx/pvs2/lock.sh"); + ungrabP.waitForFinished(); + _locked = true; return true; } @@ -70,6 +77,11 @@ bool BlankScreen::unlock() XFlush(_sysdep->dpy); + /* start the unlock.sh script */ + QProcess regrabP; + regrabP.start("/bin/bash", QStringList() << "/opt/openslx/pvs2/unlock.sh"); + regrabP.waitForFinished(); + _locked = false; return true; } |