aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp26
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h2
2 files changed, 26 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
index 50d084e3..60a313e8 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
@@ -11,6 +11,7 @@
#include <LuminaOS.h>
#include "../../LSession.h"
#include <QtConcurrent>
+#include <QMessageBox>
#include "ItemWidget.h"
//#define SSAVER QString("xscreensaver-demo")
@@ -259,6 +260,21 @@ void StartMenu::do_search(QString search, bool force){
ui->stackedWidget->setCurrentWidget(ui->page_search);
}
+bool StartMenu::promptAboutUpdates(bool &skip){
+ QString pending = LOS::systemPendingUpdates();
+ if(pending.isEmpty()){ skip = false; } //continue without skip
+ else{
+ QMessageBox dlg(QMessageBox::Question, tr("Apply Updates?"), tr("You have system updates waiting to be applied! Do you wish to install them now?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, this);
+ dlg.setDetailedText(pending);
+ dlg.setDefaultButton(QMessageBox::Yes);
+ dlg.show();
+ int ret = dlg.exec();
+ if(ret == QMessageBox::Cancel){ return false; } //do not continue
+ else{ skip = (ret==QMessageBox::No); }
+ }
+ return true;
+}
+
// ========================
// PRIVATE SLOTS
// ========================
@@ -571,12 +587,18 @@ void StartMenu::on_tool_logout_clicked(){
void StartMenu::on_tool_restart_clicked(){
emit CloseMenu();
- LSession::handle()->StartReboot();
+ QCoreApplication::processEvents();
+ bool skipupdates = false;
+ if( !promptAboutUpdates(skipupdates) ){ return; }
+ LSession::handle()->StartReboot(skipupdates);
}
void StartMenu::on_tool_shutdown_clicked(){
emit CloseMenu();
- LSession::handle()->StartShutdown();
+ QCoreApplication::processEvents();
+ bool skipupdates = false;
+ if( !promptAboutUpdates(skipupdates) ){ return; }
+ LSession::handle()->StartShutdown(skipupdates);
}
void StartMenu::on_tool_suspend_clicked(){
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h
index 249709a8..9a629cc2 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h
@@ -42,6 +42,8 @@ private:
void SortScrollArea(QScrollArea *area);
void do_search(QString search, bool force);
+ bool promptAboutUpdates(bool &skip);
+
private slots:
void LaunchItem(QString path, bool fix = true);
bgstack15