mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
Add update notification support
This commit is contained in:
parent
6f99f5d64c
commit
7385dd0838
11 changed files with 370 additions and 257 deletions
23
main.qml
23
main.qml
|
@ -767,6 +767,19 @@ ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
MsgPopup {
|
||||
id: updatepopup
|
||||
continueButton: false
|
||||
yesButton: true
|
||||
noButton: true
|
||||
property url url
|
||||
title: qsTr("Update available")
|
||||
text: qsTr("There is a newer version of Imager available.<br>Would you like to visit the website to download it?")
|
||||
onYes: {
|
||||
Qt.openUrlExternally(url)
|
||||
}
|
||||
}
|
||||
|
||||
/* Utility functions */
|
||||
function httpRequest(url, callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
@ -893,6 +906,16 @@ ApplicationWindow {
|
|||
for (var i in oslist) {
|
||||
osmodel.insert(osmodel.count-2, oslist[i])
|
||||
}
|
||||
|
||||
if ("imager" in o) {
|
||||
var imager = o["imager"]
|
||||
if ("latest_version" in imager && "url" in imager) {
|
||||
if (imageWriter.isVersionNewer(imager["latest_version"])) {
|
||||
updatepopup.url = imager["url"]
|
||||
updatepopup.openPopup()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue