aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-09-19 09:55:19 -0400
committerKen Moore <ken@pcbsd.org>2014-09-19 09:55:19 -0400
commit9a481058ac0f22a6ebbb21f8462c9a7cf438f6d8 (patch)
treee33f75ce2b041767c48c0a8c80e3f31ef956ef9b
parentMake the jpg/png suffix check case-insensitive for showing thumbnail previews... (diff)
downloadlumina-9a481058ac0f22a6ebbb21f8462c9a7cf438f6d8.tar.gz
lumina-9a481058ac0f22a6ebbb21f8462c9a7cf438f6d8.tar.bz2
lumina-9a481058ac0f22a6ebbb21f8462c9a7cf438f6d8.zip
Add the ability to lock the screen from the log out menu in lumina-desktop.
-rw-r--r--lumina-desktop/SystemWindow.cpp2
-rw-r--r--lumina-desktop/SystemWindow.h7
-rw-r--r--lumina-desktop/SystemWindow.ui7
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserWidget.h1
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:
bgstack15