From 832be86e798f3fb2ef26fe707dce8fbd6bbdca8d Mon Sep 17 00:00:00 2001 From: Floris Bos Date: Sat, 6 Mar 2021 11:40:46 +0100 Subject: [PATCH] Linux embedded: quit (reboot) when finished --- MsgPopup.qml | 13 +++++++++++++ main.qml | 7 ++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/MsgPopup.qml b/MsgPopup.qml index 9aece09..a044b19 100644 --- a/MsgPopup.qml +++ b/MsgPopup.qml @@ -20,6 +20,7 @@ Popup { property alias title: msgpopupheader.text property alias text: msgpopupbody.text property bool continueButton: true + property bool quitButton: false property bool yesButton: false property bool noButton: false signal yes() @@ -130,6 +131,18 @@ Popup { Accessible.onPressAction: clicked() } + Button { + text: qsTr("QUIT") + onClicked: { + Qt.quit() + } + Material.foreground: "#ffffff" + Material.background: "#c51a4a" + font.family: roboto.name + visible: msgpopup.quitButton + Accessible.onPressAction: clicked() + } + Text { text: " " } } } diff --git a/main.qml b/main.qml index f212f5d..dce473f 100644 --- a/main.qml +++ b/main.qml @@ -903,6 +903,11 @@ ApplicationWindow { msgpopup.text = qsTr("%1 has been erased

You can now remove the SD card from the reader").arg(dstbutton.text) else msgpopup.text = qsTr("%1 has been written to %2

You can now remove the SD card from the reader").arg(osbutton.text).arg(dstbutton.text) + if (imageWriter.isEmbeddedMode()) { + msgpopup.continueButton = false + msgpopup.quitButton = true + } + msgpopup.openPopup() imageWriter.setDst("") dstbutton.text = qsTr("CHOOSE STORAGE") @@ -959,7 +964,7 @@ ApplicationWindow { if ("imager" in o) { var imager = o["imager"] if ("latest_version" in imager && "url" in imager) { - if (imageWriter.isVersionNewer(imager["latest_version"])) { + if (!imageWriter.isEmbeddedMode() && imageWriter.isVersionNewer(imager["latest_version"])) { updatepopup.url = imager["url"] updatepopup.openPopup() }