aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/SystemWindow.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-09-19 10:20:49 -0400
committerKen Moore <ken@pcbsd.org>2014-09-19 10:20:49 -0400
commit136d287ae121eb8bfb1d9c5c0857cc5aa2fb507f (patch)
tree7bcc4e8b41025ccbe9c288c0c334f7dc7fd17a5a /lumina-desktop/SystemWindow.cpp
parentAdd the ability to lock the screen from the log out menu in lumina-desktop. (diff)
downloadlumina-136d287ae121eb8bfb1d9c5c0857cc5aa2fb507f.tar.gz
lumina-136d287ae121eb8bfb1d9c5c0857cc5aa2fb507f.tar.bz2
lumina-136d287ae121eb8bfb1d9c5c0857cc5aa2fb507f.zip
Add support for detecting whether the running user has permission to shutdown/restart the system, and enable/disable those options in the logout menu appropriately.
Diffstat (limited to 'lumina-desktop/SystemWindow.cpp')
-rw-r--r--lumina-desktop/SystemWindow.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lumina-desktop/SystemWindow.cpp b/lumina-desktop/SystemWindow.cpp
index dc9dc488..10d44524 100644
--- a/lumina-desktop/SystemWindow.cpp
+++ b/lumina-desktop/SystemWindow.cpp
@@ -20,6 +20,11 @@ SystemWindow::SystemWindow() : QDialog(), ui(new Ui::SystemWindow){
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()) );
+ //Disable the shutdown/restart buttons if necessary
+ if( !LOS::userHasShutdownAccess() ){
+ ui->tool_restart->setEnabled(false);
+ ui->tool_shutdown->setEnabled(false);
+ }
//Center this window on the screen
QDesktopWidget desktop;
this->move(desktop.screenGeometry().width()/2 - this->width()/2, desktop.screenGeometry().height()/2 - this->height()/2);
bgstack15