diff options
Diffstat (limited to 'lumina-desktop')
-rw-r--r-- | lumina-desktop/SystemWindow.cpp | 2 | ||||
-rw-r--r-- | lumina-desktop/SystemWindow.h | 7 | ||||
-rw-r--r-- | lumina-desktop/SystemWindow.ui | 7 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/UserWidget.h | 1 |
4 files changed, 17 insertions, 0 deletions
diff --git a/lumina-desktop/SystemWindow.cpp b/lumina-desktop/SystemWindow.cpp index 24bd2594..dc9dc488 100644 --- a/lumina-desktop/SystemWindow.cpp +++ b/lumina-desktop/SystemWindow.cpp @@ -13,11 +13,13 @@ SystemWindow::SystemWindow() : QDialog(), ui(new Ui::SystemWindow){ ui->tool_restart->setIcon( LXDG::findIcon("system-reboot","") ); ui->tool_shutdown->setIcon( LXDG::findIcon("system-shutdown","") ); ui->push_cancel->setIcon( LXDG::findIcon("dialog-cancel","") ); + ui->push_lock->setIcon( LXDG::findIcon("system-lock-screen","") ); //Connect the signals/slots connect(ui->tool_logout, SIGNAL(clicked()), this, SLOT(sysLogout()) ); connect(ui->tool_restart, SIGNAL(clicked()), this, SLOT(sysRestart()) ); connect(ui->tool_shutdown, SIGNAL(clicked()), this, SLOT(sysShutdown()) ); connect(ui->push_cancel, SIGNAL(clicked()), this, SLOT(sysCancel()) ); + connect(ui->push_lock, SIGNAL(clicked()), this, SLOT(sysLock()) ); //Center this window on the screen QDesktopWidget desktop; this->move(desktop.screenGeometry().width()/2 - this->width()/2, desktop.screenGeometry().height()/2 - this->height()/2); diff --git a/lumina-desktop/SystemWindow.h b/lumina-desktop/SystemWindow.h index c8d70c71..3be8642e 100644 --- a/lumina-desktop/SystemWindow.h +++ b/lumina-desktop/SystemWindow.h @@ -5,6 +5,7 @@ #include <QCoreApplication> #include <QDesktopWidget> #include <QList> +#include <QProcess> #include "ui_SystemWindow.h" #include "Globals.h" @@ -51,6 +52,12 @@ private slots: void sysCancel(){ this->close(); } + + void sysLock(){ + qDebug() << "Locking the desktop..."; + QProcess::startDetached("xscreensaver-command -lock"); + this->close(); + } }; #endif
\ No newline at end of file diff --git a/lumina-desktop/SystemWindow.ui b/lumina-desktop/SystemWindow.ui index c4384ee9..2b21757f 100644 --- a/lumina-desktop/SystemWindow.ui +++ b/lumina-desktop/SystemWindow.ui @@ -135,6 +135,13 @@ </property> </spacer> </item> + <item> + <widget class="QPushButton" name="push_lock"> + <property name="text"> + <string>Lock Screen</string> + </property> + </widget> + </item> </layout> </item> </layout> diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.h b/lumina-desktop/panel-plugins/userbutton/UserWidget.h index 0b42bff8..132969ad 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserWidget.h +++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.h @@ -36,6 +36,7 @@ public: UserWidget(QWidget *parent=0); ~UserWidget(); +public slots: void UpdateMenu(); private: |