aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/SystemWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-desktop/SystemWindow.cpp')
-rw-r--r--src-qt5/core/lumina-desktop/SystemWindow.cpp35
1 files changed, 23 insertions, 12 deletions
diff --git a/src-qt5/core/lumina-desktop/SystemWindow.cpp b/src-qt5/core/lumina-desktop/SystemWindow.cpp
index cd09c9bd..dbcec2a2 100644
--- a/src-qt5/core/lumina-desktop/SystemWindow.cpp
+++ b/src-qt5/core/lumina-desktop/SystemWindow.cpp
@@ -12,6 +12,7 @@
SystemWindow::SystemWindow() : QDialog(), ui(new Ui::SystemWindow){
ui->setupUi(this); //load the designer file
+ this->setObjectName("LeaveDialog");
//Setup the window flags
this->setWindowFlags( Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
//Setup the icons based on the current theme
@@ -28,6 +29,7 @@ SystemWindow::SystemWindow() : QDialog(), ui(new Ui::SystemWindow){
connect(ui->tool_suspend, SIGNAL(clicked()), this, SLOT(sysSuspend()) );
connect(ui->push_cancel, SIGNAL(clicked()), this, SLOT(sysCancel()) );
connect(ui->push_lock, SIGNAL(clicked()), this, SLOT(sysLock()) );
+ connect(ui->tool_restart_updates, SIGNAL(clicked()), this, SLOT(sysUpdate()) );
//Disable buttons if necessary
updateWindow();
ui->tool_suspend->setVisible(LOS::systemCanSuspend()); //does not change with time - just do a single check
@@ -45,6 +47,7 @@ void SystemWindow::updateWindow(){
bool ok = LOS::userHasShutdownAccess();
ui->tool_restart->setEnabled(ok);
ui->tool_shutdown->setEnabled(ok);
+ ui->frame_update->setVisible( !LOS::systemPendingUpdates().isEmpty() );
//Center this window on the current screen
QPoint center = QApplication::desktop()->screenGeometry(QCursor::pos()).center(); //get the center of the current screen
this->move(center.x() - this->width()/2, center.y() - this->height()/2);
@@ -73,21 +76,29 @@ void SystemWindow::sysLogout(){
LSession::processEvents();
QTimer::singleShot(0, LSession::handle(), SLOT(StartLogout()) );
}
-
+
void SystemWindow::sysRestart(){
- bool skip = false;
- if(!promptAboutUpdates(skip)){ this->close(); return; } //cancelled
- this->close();
- LSession::processEvents();
- LSession::handle()->StartReboot(skip);
+ //bool skip = false;
+ //if(!promptAboutUpdates(skip)){ this->close(); return; } //cancelled
+ //this->close();
+ //LSession::processEvents();
+ LSession::handle()->StartReboot(true);
+}
+
+void SystemWindow::sysUpdate(){
+ //bool skip = false;
+ //if(!promptAboutUpdates(skip)){ this->close(); return; } //cancelled
+ //this->close();
+ //LSession::processEvents();
+ LSession::handle()->StartReboot(false);
}
-
+
void SystemWindow::sysShutdown(){
- bool skip = false;
- if(!promptAboutUpdates(skip)){ this->close(); return; } //cancelled
- this->close();
- LSession::processEvents();
- LSession::handle()->StartShutdown(skip);
+ //bool skip = false;
+ //if(!promptAboutUpdates(skip)){ this->close(); return; } //cancelled
+ //this->close();
+ //LSession::processEvents();
+ LSession::handle()->StartShutdown();
}
void SystemWindow::sysSuspend(){
bgstack15