[GODT-961] Update release notes link

* on release notes, check updates if link missing
* on update set release note link
* update version and links with every check
* clean old release notes
* change paths to IEapp notes
This commit is contained in:
Jakub
2021-01-18 11:52:17 +01:00
committed by Jakub Cuth
parent 6523b906af
commit a72f52a5ed
22 changed files with 127 additions and 105 deletions

View File

@ -147,6 +147,9 @@ func checkAndHandleUpdate(u types.Updater, f frontend.Frontend, autoUpdate bool)
return
}
// Update links in UI
f.SetVersion(version)
if !u.IsUpdateApplicable(version) {
logrus.Debug("No need to update")
return

View File

@ -95,6 +95,9 @@ func checkAndHandleUpdate(u types.Updater, f frontend.Frontend, autoUpdate bool)
return
}
// Update links in UI
f.SetVersion(version)
if !u.IsUpdateApplicable(version) {
logrus.Debug("No need to update")
return

View File

@ -230,8 +230,6 @@ func (f *frontendCLI) NotifyManualUpdate(update updater.VersionInfo, canInstall
// NOTE: Save the update somewhere so that it can be installed when user chooses "install now".
}
func (f *frontendCLI) NotifySilentUpdateInstalled() {
}
func (f *frontendCLI) NotifySilentUpdateError(err error) {
}
func (f *frontendCLI) SetVersion(version updater.VersionInfo) {}
func (f *frontendCLI) NotifySilentUpdateInstalled() {}
func (f *frontendCLI) NotifySilentUpdateError(err error) {}

View File

@ -257,8 +257,6 @@ func (f *frontendCLI) NotifyManualUpdate(update updater.VersionInfo, canInstall
// NOTE: Save the update somewhere so that it can be installed when user chooses "install now".
}
func (f *frontendCLI) NotifySilentUpdateInstalled() {
}
func (f *frontendCLI) NotifySilentUpdateError(err error) {
}
func (f *frontendCLI) SetVersion(version updater.VersionInfo) {}
func (f *frontendCLI) NotifySilentUpdateInstalled() {}
func (f *frontendCLI) NotifySilentUpdateError(err error) {}

View File

@ -42,6 +42,7 @@ var (
type Frontend interface {
Loop() error
NotifyManualUpdate(update updater.VersionInfo, canInstall bool)
SetVersion(update updater.VersionInfo)
NotifySilentUpdateInstalled()
NotifySilentUpdateError(error)
}

View File

@ -135,9 +135,7 @@ Item {
textColor : Style.main.textDisabled
fontSize : Style.main.fontSize
textUnderline : true
onClicked : {
Qt.openUrlExternally(go.updateReleaseNotesLink)
}
onClicked : gui.openReleaseNotes()
}
}
}

View File

@ -303,6 +303,13 @@ Item {
winMain.bubbleNote.show()
}
function openReleaseNotes(){
if go.updateReleaseNotesLink == "" {
go.checkForUpdates()
}
Qt.openUrlExternally(go.updateReleaseNotesLink)
}
// On start
Component.onCompleted : {
// set messages for translations

View File

@ -405,6 +405,14 @@ Item {
}
*/
function openReleaseNotes(){
if go.updateReleaseNotesLink == "" {
go.checkForUpdates()
}
Qt.openUrlExternally(go.updateReleaseNotesLink)
}
property string areYouSureYouWantToQuit : qsTr("There are incomplete processes - some items are not yet transferred. Do you really want to stop and quit?")
// On start
Component.onCompleted : {

View File

@ -113,7 +113,7 @@ Item {
MouseArea {
anchors.fill: parent
onClicked : {
go.openLicenseFile()
go.openLicenseFile()
}
cursorShape: Qt.PointingHandCursor
}
@ -127,9 +127,7 @@ Item {
font.underline: true
MouseArea {
anchors.fill: parent
onClicked : {
Qt.openUrlExternally(go.updateReleaseNotesLink)
}
onClicked : gui.openReleaseNotes()
cursorShape: Qt.PointingHandCursor
}
}

View File

@ -62,7 +62,7 @@ Rectangle {
id: message
font.pointSize: root.fontSize * Style.pt
}
ClickIconText {
id: linkText
anchors.verticalCenter : message.verticalCenter
@ -107,31 +107,31 @@ Rectangle {
onStateChanged : {
switch (root.state) {
case "internetCheck":
break;
break;
case "noInternet" :
gui.warningFlags |= Style.warnInfoBar
retryInternet.start()
secLeft=checkInterval[iTry]
break;
gui.warningFlags |= Style.warnInfoBar
retryInternet.start()
secLeft=checkInterval[iTry]
break;
case "oldVersion":
gui.warningFlags |= Style.warnInfoBar
break;
gui.warningFlags |= Style.warnInfoBar
break;
case "forceUpdate":
gui.warningFlags |= Style.errorInfoBar
break;
gui.warningFlags |= Style.errorInfoBar
break;
case "upToDate":
gui.warningFlags &= ~Style.warnInfoBar
iTry = 0
secLeft=checkInterval[iTry]
break;
gui.warningFlags &= ~Style.warnInfoBar
iTry = 0
secLeft=checkInterval[iTry]
break;
case "updateRestart":
gui.warningFlags |= Style.warnInfoBar
break;
gui.warningFlags |= Style.warnInfoBar
break;
case "updateError":
gui.warningFlags |= Style.errorInfoBar
break;
gui.warningFlags |= Style.errorInfoBar
break;
default :
break;
break;
}
if (root.state!="noInternet") {
@ -248,9 +248,7 @@ Rectangle {
target: linkText
visible: true
text: "(" + qsTr("view release notes", "display the release notes from the new version") + ")"
onClicked: {
Qt.openUrlExternally(go.updateReleaseNotesLink)
}
onClicked: gui.openReleaseNotes()
}
PropertyChanges {
target: actionText

View File

@ -118,14 +118,18 @@ func (f *FrontendQt) Loop() (err error) {
}
func (f *FrontendQt) NotifyManualUpdate(update updater.VersionInfo, canInstall bool) {
f.Qml.SetUpdateVersion(update.Version.String())
f.Qml.SetUpdateLandingPage(update.LandingPage)
f.Qml.SetUpdateReleaseNotesLink(update.ReleaseNotesPage)
f.SetVersion(update)
f.Qml.SetUpdateCanInstall(canInstall)
f.updateInfo = update
f.Qml.NotifyManualUpdate()
}
func (f *FrontendQt) SetVersion(version updater.VersionInfo) {
f.Qml.SetUpdateVersion(version.Version.String())
f.Qml.SetUpdateLandingPage(version.LandingPage)
f.Qml.SetUpdateReleaseNotesLink(version.ReleaseNotesPage)
f.updateInfo = version
}
func (f *FrontendQt) NotifySilentUpdateInstalled() {
f.Qml.NotifySilentUpdateRestartNeeded()
}
@ -428,6 +432,8 @@ func (f *FrontendQt) checkForUpdates() {
return
}
f.SetVersion(version)
if !f.updater.IsUpdateApplicable(version) {
logrus.Debug("No need to update")
return

View File

@ -47,6 +47,9 @@ func (s *FrontendHeadless) NotifyManualUpdate(update updater.VersionInfo, canIns
// NOTE: Save the update somewhere so that it can be installed when user chooses "install now".
}
func (s *FrontendHeadless) SetVersion(update updater.VersionInfo) {
}
func (s *FrontendHeadless) NotifySilentUpdateInstalled() {
}

View File

@ -163,14 +163,18 @@ func (s *FrontendQt) Loop() (err error) {
}
func (s *FrontendQt) NotifyManualUpdate(update updater.VersionInfo, canInstall bool) {
s.Qml.SetUpdateVersion(update.Version.String())
s.Qml.SetUpdateLandingPage(update.LandingPage)
s.Qml.SetUpdateReleaseNotesLink(update.ReleaseNotesPage)
s.SetVersion(update)
s.Qml.SetUpdateCanInstall(canInstall)
s.updateInfo = update
s.Qml.NotifyManualUpdate()
}
func (s *FrontendQt) SetVersion(version updater.VersionInfo) {
s.Qml.SetUpdateVersion(version.Version.String())
s.Qml.SetUpdateLandingPage(version.LandingPage)
s.Qml.SetUpdateReleaseNotesLink(version.ReleaseNotesPage)
s.updateInfo = version
}
func (s *FrontendQt) NotifySilentUpdateInstalled() {
s.Qml.NotifySilentUpdateRestartNeeded()
}
@ -420,6 +424,8 @@ func (s *FrontendQt) checkForUpdates() {
return
}
s.SetVersion(version)
if !s.updater.IsUpdateApplicable(version) {
logrus.Debug("No need to update")
return

View File

@ -48,6 +48,9 @@ func (s *FrontendHeadless) NotifyManualUpdate(update updater.VersionInfo, canIns
// NOTE: Save the update somewhere so that it can be installed when user chooses "install now".
}
func (s *FrontendHeadless) SetVersion(update updater.VersionInfo) {
}
func (s *FrontendHeadless) NotifySilentUpdateInstalled() {
}