Linux embedded: quit (reboot) when finished

This commit is contained in:
Floris Bos 2021-03-06 11:40:46 +01:00
parent 2d87a2275f
commit 832be86e79
2 changed files with 19 additions and 1 deletions

View file

@ -20,6 +20,7 @@ Popup {
property alias title: msgpopupheader.text property alias title: msgpopupheader.text
property alias text: msgpopupbody.text property alias text: msgpopupbody.text
property bool continueButton: true property bool continueButton: true
property bool quitButton: false
property bool yesButton: false property bool yesButton: false
property bool noButton: false property bool noButton: false
signal yes() signal yes()
@ -130,6 +131,18 @@ Popup {
Accessible.onPressAction: clicked() 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: " " } Text { text: " " }
} }
} }

View file

@ -903,6 +903,11 @@ ApplicationWindow {
msgpopup.text = qsTr("<b>%1</b> has been erased<br><br>You can now remove the SD card from the reader").arg(dstbutton.text) msgpopup.text = qsTr("<b>%1</b> has been erased<br><br>You can now remove the SD card from the reader").arg(dstbutton.text)
else else
msgpopup.text = qsTr("<b>%1</b> has been written to <b>%2</b><br><br>You can now remove the SD card from the reader").arg(osbutton.text).arg(dstbutton.text) msgpopup.text = qsTr("<b>%1</b> has been written to <b>%2</b><br><br>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() msgpopup.openPopup()
imageWriter.setDst("") imageWriter.setDst("")
dstbutton.text = qsTr("CHOOSE STORAGE") dstbutton.text = qsTr("CHOOSE STORAGE")
@ -959,7 +964,7 @@ ApplicationWindow {
if ("imager" in o) { if ("imager" in o) {
var imager = o["imager"] var imager = o["imager"]
if ("latest_version" in imager && "url" in 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.url = imager["url"]
updatepopup.openPopup() updatepopup.openPopup()
} }