diff options
author | Ken Moore <moorekou@gmail.com> | 2016-08-18 15:50:49 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-08-18 15:50:49 -0400 |
commit | bd87d69b5c64a80a209e5cd8e3f0c7fac608c87c (patch) | |
tree | 1c3717afdba77275ad9b2028ee9eefae71682442 /src-qt5/core/libLumina | |
parent | Oops - NOW the OS-detect.pri file is fixed for the LIBPREFIX variable (also c... (diff) | |
download | lumina-bd87d69b5c64a80a209e5cd8e3f0c7fac608c87c.tar.gz lumina-bd87d69b5c64a80a209e5cd8e3f0c7fac608c87c.tar.bz2 lumina-bd87d69b5c64a80a209e5cd8e3f0c7fac608c87c.zip |
Add in pending update detection/skipping ability to the main logout window (not the start menu options yet).
Diffstat (limited to 'src-qt5/core/libLumina')
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-Debian.cpp | 9 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-DragonFly.cpp | 9 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp | 16 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-Gentoo.cpp | 9 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-Linux.cpp | 9 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-NetBSD.cpp | 9 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-OpenBSD.cpp | 9 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-kFreeBSD.cpp | 9 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-template.cpp | 8 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS.h | 6 |
10 files changed, 71 insertions, 22 deletions
diff --git a/src-qt5/core/libLumina/LuminaOS-Debian.cpp b/src-qt5/core/libLumina/LuminaOS-Debian.cpp index 8794928a..4acbe7d8 100644 --- a/src-qt5/core/libLumina/LuminaOS-Debian.cpp +++ b/src-qt5/core/libLumina/LuminaOS-Debian.cpp @@ -152,15 +152,20 @@ bool LOS::systemPerformingUpdates(){ return false; //Not implemented yet } +//Return the details of any updates which are waiting to apply on shutdown +QString LOS::systemPendingUpdates(){ + return ""; +} + //System Shutdown -void LOS::systemShutdown(){ //start poweroff sequence +void LOS::systemShutdown(bool skipupdates){ //start poweroff sequence QProcess::startDetached("dbus-send --system --print-reply \ --dest=org.freedesktop.login1 /org/freedesktop/login1 \ org.freedesktop.login1.Manager.PowerOff boolean:true"); } //System Restart -void LOS::systemRestart(){ //start reboot sequence +void LOS::systemRestart(bool skipupdates){ //start reboot sequence QProcess::startDetached("dbus-send --system --print-reply \ --dest=org.freedesktop.login1 /org/freedesktop/login1 \ org.freedesktop.login1.Manager.Reboot boolean:true"); diff --git a/src-qt5/core/libLumina/LuminaOS-DragonFly.cpp b/src-qt5/core/libLumina/LuminaOS-DragonFly.cpp index c23cc5d7..ac25815f 100644 --- a/src-qt5/core/libLumina/LuminaOS-DragonFly.cpp +++ b/src-qt5/core/libLumina/LuminaOS-DragonFly.cpp @@ -228,13 +228,18 @@ bool LOS::systemPerformingUpdates(){ return false; //Not implemented yet } +//Return the details of any updates which are waiting to apply on shutdown +QString LOS::systemPendingUpdates(){ + return ""; +} + //System Shutdown -void LOS::systemShutdown(){ //start poweroff sequence +void LOS::systemShutdown(bool skipupdates){ //start poweroff sequence QProcess::startDetached("shutdown -p now"); } //System Restart -void LOS::systemRestart(){ //start reboot sequence +void LOS::systemRestart(bool skipupdates){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } diff --git a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp index e0706a98..10216f92 100644 --- a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp +++ b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp @@ -210,14 +210,22 @@ bool LOS::systemPerformingUpdates(){ return (QProcess::execute("pgrep -F /tmp/.updateInProgress")==0); //this is 0 if updating right now } +//Return the details of any updates which are waiting to apply on shutdown +QString LOS::systemPendingUpdates(){ + if(QFile::exists("/tmp/.rebootRequired")){ return LUtils::readFile("/tmp/.rebootRequired").join("\n"); } + else{ return ""; } +} + //System Shutdown -void LOS::systemShutdown(){ //start poweroff sequence - QProcess::startDetached("shutdown -p now"); +void LOS::systemShutdown(bool skipupdates){ //start poweroff sequence + if(skipupdates){QProcess::startDetached("shutdown -po now"); } + else{ QProcess::startDetached("shutdown -p now"); } } //System Restart -void LOS::systemRestart(){ //start reboot sequence - QProcess::startDetached("shutdown -r now"); +void LOS::systemRestart(bool skipupdates){ //start reboot sequence + if(skipupdates){QProcess::startDetached("shutdown -ro now"); } + else{ QProcess::startDetached("shutdown -r now"); } } //Check for suspend support diff --git a/src-qt5/core/libLumina/LuminaOS-Gentoo.cpp b/src-qt5/core/libLumina/LuminaOS-Gentoo.cpp index 3ec01dde..b92d1b02 100644 --- a/src-qt5/core/libLumina/LuminaOS-Gentoo.cpp +++ b/src-qt5/core/libLumina/LuminaOS-Gentoo.cpp @@ -152,15 +152,20 @@ bool LOS::systemPerformingUpdates(){ return false; //Not implemented yet } +//Return the details of any updates which are waiting to apply on shutdown +QString LOS::systemPendingUpdates(){ + return ""; +} + //System Shutdown -void LOS::systemShutdown(){ //start poweroff sequence +void LOS::systemShutdown(bool skipupdates){ //start poweroff sequence QProcess::startDetached("dbus-send --system --print-reply \ --dest=org.freedesktop.login1 /org/freedesktop/login1 \ org.freedesktop.login1.Manager.PowerOff boolean:true"); } //System Restart -void LOS::systemRestart(){ //start reboot sequence +void LOS::systemRestart(bool skipupdates){ //start reboot sequence QProcess::startDetached("dbus-send --system --print-reply \ --dest=org.freedesktop.login1 /org/freedesktop/login1 \ org.freedesktop.login1.Manager.Reboot boolean:true"); diff --git a/src-qt5/core/libLumina/LuminaOS-Linux.cpp b/src-qt5/core/libLumina/LuminaOS-Linux.cpp index 2e9b1e18..9d5980eb 100644 --- a/src-qt5/core/libLumina/LuminaOS-Linux.cpp +++ b/src-qt5/core/libLumina/LuminaOS-Linux.cpp @@ -144,13 +144,18 @@ bool LOS::systemPerformingUpdates(){ return false; //Not implemented yet } +//Return the details of any updates which are waiting to apply on shutdown +QString LOS::systemPendingUpdates(){ + return ""; +} + //System Shutdown -void LOS::systemShutdown(){ //start poweroff sequence +void LOS::systemShutdown(bool skipupdates){ //start poweroff sequence QProcess::startDetached("shutdown -P -h now"); } //System Restart -void LOS::systemRestart(){ //start reboot sequence +void LOS::systemRestart(bool skipupdates){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } diff --git a/src-qt5/core/libLumina/LuminaOS-NetBSD.cpp b/src-qt5/core/libLumina/LuminaOS-NetBSD.cpp index 2183eb93..75feb345 100644 --- a/src-qt5/core/libLumina/LuminaOS-NetBSD.cpp +++ b/src-qt5/core/libLumina/LuminaOS-NetBSD.cpp @@ -85,13 +85,18 @@ bool LOS::systemPerformingUpdates(){ return false; //Not implemented yet } +//Return the details of any updates which are waiting to apply on shutdown +QString LOS::systemPendingUpdates(){ + return ""; +} + //System Shutdown -void LOS::systemShutdown(){ //start poweroff sequence +void LOS::systemShutdown(bool skipupdates){ //start poweroff sequence QProcess::startDetached("shutdown -p now"); } //System Restart -void LOS::systemRestart(){ //start reboot sequence +void LOS::systemRestart(bool skipupdates){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } diff --git a/src-qt5/core/libLumina/LuminaOS-OpenBSD.cpp b/src-qt5/core/libLumina/LuminaOS-OpenBSD.cpp index a0d6d1a0..b208c314 100644 --- a/src-qt5/core/libLumina/LuminaOS-OpenBSD.cpp +++ b/src-qt5/core/libLumina/LuminaOS-OpenBSD.cpp @@ -164,13 +164,18 @@ bool LOS::systemPerformingUpdates(){ return false; //Not implemented yet } +//Return the details of any updates which are waiting to apply on shutdown +QString LOS::systemPendingUpdates(){ + return ""; +} + //System Shutdown -void LOS::systemShutdown(){ //start poweroff sequence +void LOS::systemShutdown(bool skipupdates){ //start poweroff sequence QProcess::startDetached("shutdown -p now"); } //System Restart -void LOS::systemRestart(){ //start reboot sequence +void LOS::systemRestart(bool skipupdates){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } diff --git a/src-qt5/core/libLumina/LuminaOS-kFreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-kFreeBSD.cpp index b3721e7d..62bbdb1c 100644 --- a/src-qt5/core/libLumina/LuminaOS-kFreeBSD.cpp +++ b/src-qt5/core/libLumina/LuminaOS-kFreeBSD.cpp @@ -131,13 +131,18 @@ bool LOS::systemPerformingUpdates(){ return false; //Not implemented yet } +//Return the details of any updates which are waiting to apply on shutdown +QString LOS::systemPendingUpdates(){ + return ""; +} + //System Shutdown -void LOS::systemShutdown(){ //start poweroff sequence +void LOS::systemShutdown(bool skipupdates){ //start poweroff sequence QProcess::startDetached("shutdown -h now"); } //System Restart -void LOS::systemRestart(){ //start reboot sequence +void LOS::systemRestart(bool skipupdates){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } diff --git a/src-qt5/core/libLumina/LuminaOS-template.cpp b/src-qt5/core/libLumina/LuminaOS-template.cpp index 00bbae52..c6dedf3b 100644 --- a/src-qt5/core/libLumina/LuminaOS-template.cpp +++ b/src-qt5/core/libLumina/LuminaOS-template.cpp @@ -78,14 +78,18 @@ bool LOS::userHasShutdownAccess(){ bool LOS::systemPerformingUpdates(){ return false; //Not implemented yet } +//Return the details of any updates which are waiting to apply on shutdown +QString LOS::systemPendingUpdates(){ + return ""; +} //System Shutdown -void LOS::systemShutdown(){ //start poweroff sequence +void LOS::systemShutdown(bool skipupdates){ //start poweroff sequence QProcess::startDetached("shutdown -p now"); } //System Restart -void LOS::systemRestart(){ //start reboot sequence +void LOS::systemRestart(bool skipupdates){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } diff --git a/src-qt5/core/libLumina/LuminaOS.h b/src-qt5/core/libLumina/LuminaOS.h index a18f2909..50d6baec 100644 --- a/src-qt5/core/libLumina/LuminaOS.h +++ b/src-qt5/core/libLumina/LuminaOS.h @@ -61,10 +61,12 @@ public: //Check for user system permission (shutdown/restart) static bool userHasShutdownAccess(); static bool systemPerformingUpdates(); + static QString systemPendingUpdates(); //returns nothing if no updates waiting to install at shutdown + //System Shutdown - static void systemShutdown(); //start poweroff sequence + static void systemShutdown(bool skipupdates = false); //start poweroff sequence //System Restart - static void systemRestart(); //start reboot sequence + static void systemRestart(bool skipupdates = false); //start reboot sequence //Check for suspend support static bool systemCanSuspend(); //Put the system into the suspend state |