diff options
author | Kris Moore <kris@pcbsd.org> | 2014-09-04 11:42:13 -0400 |
---|---|---|
committer | Kris Moore <kris@pcbsd.org> | 2014-09-04 11:42:13 -0400 |
commit | 71737f70949bd25f9aa8bc4e7d03039ba83c6cb1 (patch) | |
tree | ab29e864d1ae59d10cc6875af9541e3ad306b2fb /lumina-desktop/SystemWindow.cpp | |
parent | Initial commit (diff) | |
download | lumina-71737f70949bd25f9aa8bc4e7d03039ba83c6cb1.tar.gz lumina-71737f70949bd25f9aa8bc4e7d03039ba83c6cb1.tar.bz2 lumina-71737f70949bd25f9aa8bc4e7d03039ba83c6cb1.zip |
Initial import of the lumina code from pcbsd git repo
Diffstat (limited to 'lumina-desktop/SystemWindow.cpp')
-rw-r--r-- | lumina-desktop/SystemWindow.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/lumina-desktop/SystemWindow.cpp b/lumina-desktop/SystemWindow.cpp new file mode 100644 index 00000000..24bd2594 --- /dev/null +++ b/lumina-desktop/SystemWindow.cpp @@ -0,0 +1,48 @@ +#include "SystemWindow.h" +#include "ui_SystemWindow.h" + +#include "LSession.h" +#include <unistd.h> //for usleep() usage + +SystemWindow::SystemWindow() : QDialog(), ui(new Ui::SystemWindow){ + ui->setupUi(this); //load the designer file + //Setup the window flags + this->setWindowFlags( Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); + //Setup the icons based on the current theme + ui->tool_logout->setIcon( LXDG::findIcon("system-log-out","") ); + ui->tool_restart->setIcon( LXDG::findIcon("system-reboot","") ); + ui->tool_shutdown->setIcon( LXDG::findIcon("system-shutdown","") ); + ui->push_cancel->setIcon( LXDG::findIcon("dialog-cancel","") ); + //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()) ); + //Center this window on the screen + QDesktopWidget desktop; + this->move(desktop.screenGeometry().width()/2 - this->width()/2, desktop.screenGeometry().height()/2 - this->height()/2); + this->show(); +} + +SystemWindow::~SystemWindow(){ + +} + +void SystemWindow::closeAllWindows(){ + if( LSession::sessionSettings()->value("PlayLogoutAudio",true).toBool() ){ + LSession::playAudioFile("/usr/local/share/Lumina-DE/Logout.ogg"); + } + QList<WId> WL = LX11::WindowList(); + for(int i=0; i<WL.length(); i++){ + LX11::CloseWindow(WL[i]); + LSession::processEvents(); + } + //Now go through the list again and kill any remaining windows + usleep(60); //60 ms pause + WL = LX11::WindowList(); + for(int i=0; i<WL.length(); i++){ + LX11::KillWindow(WL[i]); + LSession::processEvents(); + } + LSession::processEvents(); +} |