aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2016-11-21 10:04:28 -0500
committerKen Moore <ken@ixsystems.com>2016-11-21 10:04:28 -0500
commit3f885fb37548a8ba362ac2519717379f250895cb (patch)
tree49f8251f14f695d98fefed52ee125f56500565b3
parentGet a bit more of the input device class working - using lumina-config for te... (diff)
downloadlumina-3f885fb37548a8ba362ac2519717379f250895cb.tar.gz
lumina-3f885fb37548a8ba362ac2519717379f250895cb.tar.bz2
lumina-3f885fb37548a8ba362ac2519717379f250895cb.zip
Add a new menu plugin: "lockdesktop".
This just adds a shortcut to the context menu for locking the desktop session.
-rw-r--r--src-qt5/core-utils/lumina-config/LPlugins.cpp7
-rw-r--r--src-qt5/core/lumina-desktop/LDesktop.cpp7
-rw-r--r--src-qt5/core/lumina-desktop/LDesktop.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/src-qt5/core-utils/lumina-config/LPlugins.cpp b/src-qt5/core-utils/lumina-config/LPlugins.cpp
index dfd490e6..aa691df4 100644
--- a/src-qt5/core-utils/lumina-config/LPlugins.cpp
+++ b/src-qt5/core-utils/lumina-config/LPlugins.cpp
@@ -307,6 +307,13 @@ void LPlugins::LoadMenuPlugins(){
info.ID = "jsonmenu";
info.icon = "text-x-script";
MENU.insert(info.ID, info);
+ //Lock Screen item
+ info = LPI(); //clear it
+ info.name = QObject::tr("Lock Session");
+ info.description = QObject::tr("Lock the current desktop session");
+ info.ID = "lockdesktop";
+ info.icon = "system-lock-screen";
+ MENU.insert(info.ID, info);
}
void LPlugins::LoadColorItems(){
diff --git a/src-qt5/core/lumina-desktop/LDesktop.cpp b/src-qt5/core/lumina-desktop/LDesktop.cpp
index b08251bd..5031fb96 100644
--- a/src-qt5/core/lumina-desktop/LDesktop.cpp
+++ b/src-qt5/core/lumina-desktop/LDesktop.cpp
@@ -96,7 +96,11 @@ void LDesktop::UpdateGeometry(){
//qDebug() << " - Done With Desktop Geom Updates";
QTimer::singleShot(0, this, SLOT(UpdatePanels()));
}
-
+
+void LDesktop::SystemLock(){
+ QProcess::startDetached("xscreensaver-command -lock");
+}
+
void LDesktop::SystemLogout(){
LSession::handle()->systemWindow();
}
@@ -279,6 +283,7 @@ void LDesktop::UpdateMenu(bool fast){
usewinmenu=false;
for(int i=0; i<items.length(); i++){
if(items[i]=="terminal"){ deskMenu->addAction(LXDG::findIcon("utilities-terminal",""), tr("Terminal"), this, SLOT(SystemTerminal()) ); }
+ else if(items[i]=="lockdesktop"){ deskMenu->addAction(LXDG::findIcon("system-lock-screen",""), tr("Lock Session"), this, SLOT(SystemLock()) ); }
else if(items[i]=="filemanager"){ deskMenu->addAction( LXDG::findIcon("user-home",""), tr("Browse Files"), this, SLOT(SystemFileManager()) ); }
else if(items[i]=="applications"){ deskMenu->addMenu( LSession::handle()->applicationMenu() ); }
else if(items[i]=="line"){ deskMenu->addSeparator(); }
diff --git a/src-qt5/core/lumina-desktop/LDesktop.h b/src-qt5/core/lumina-desktop/LDesktop.h
index c576a805..378db75b 100644
--- a/src-qt5/core/lumina-desktop/LDesktop.h
+++ b/src-qt5/core/lumina-desktop/LDesktop.h
@@ -50,6 +50,7 @@ public:
void UpdateGeometry();
public slots:
+ void SystemLock();
void SystemLogout();
void SystemTerminal();
void SystemFileManager();
bgstack15