wait for release notes check and then open externally

This commit is contained in:
Jakub
2021-01-19 16:30:50 +01:00
committed by Jakub Cuth
parent a72f52a5ed
commit a5b9f4c3f1
8 changed files with 139 additions and 92 deletions

View File

@ -261,6 +261,9 @@ Item {
winMain.tlsBarState="notOK" winMain.tlsBarState="notOK"
} }
onOpenReleaseNotesExternally: {
Qt.openUrlExternally(go.updateReleaseNotesLink)
}
} }
@ -304,12 +307,14 @@ Item {
} }
function openReleaseNotes(){ function openReleaseNotes(){
if go.updateReleaseNotesLink == "" { if (go.updateReleaseNotesLink == "") {
go.checkForUpdates() go.checkAndOpenReleaseNotes()
return
} }
Qt.openUrlExternally(go.updateReleaseNotesLink) go.openReleaseNotesExternally()
} }
// On start // On start
Component.onCompleted : { Component.onCompleted : {
// set messages for translations // set messages for translations

View File

@ -292,6 +292,12 @@ Item {
onUpdateFinished : { onUpdateFinished : {
winMain.dialogUpdate.finished(hasError) winMain.dialogUpdate.finished(hasError)
} }
onOpenReleaseNotesExternally: {
Qt.openUrlExternally(go.updateReleaseNotesLink)
}
} }
function folderIcon(folderName, folderType) { // translations function folderIcon(folderName, folderType) { // translations
@ -406,10 +412,11 @@ Item {
*/ */
function openReleaseNotes(){ function openReleaseNotes(){
if go.updateReleaseNotesLink == "" { if (go.updateReleaseNotesLink == "") {
go.checkForUpdates() go.checkAndOpenReleaseNotes()
return
} }
Qt.openUrlExternally(go.updateReleaseNotesLink) go.openReleaseNotesExternally()
} }

View File

@ -299,7 +299,7 @@ Window {
property string updateVersion : "QA.1.0" property string updateVersion : "QA.1.0"
property bool updateCanInstall: true property bool updateCanInstall: true
property string updateLandingPage : "https://protonmail.com/bridge/download/" property string updateLandingPage : "https://protonmail.com/bridge/download/"
property string updateReleaseNotesLink : "https://protonmail.com/download/bridge/release_notes.html" property string updateReleaseNotesLink : "" // "https://protonmail.com/download/bridge/release_notes.html"
signal notifyManualUpdate() signal notifyManualUpdate()
signal notifyManualUpdateRestartNeeded() signal notifyManualUpdateRestartNeeded()
signal notifyManualUpdateError() signal notifyManualUpdateError()
@ -312,6 +312,11 @@ Window {
function startManualUpdate() { function startManualUpdate() {
console.log("startManualUpdate") console.log("startManualUpdate")
} }
function checkAndOpenReleaseNotes() {
console.log("check for release notes")
go.updateReleaseNotesLink = "https://protonmail.com/download/bridge/release_notes.html"
go.openReleaseNotesExternally()
}
property string credits : "here;goes;list;;of;;used;packages;" property string credits : "here;goes;list;;of;;used;packages;"
@ -349,6 +354,7 @@ Window {
signal notifyAddressChangedLogout(string accname) signal notifyAddressChangedLogout(string accname)
signal failedAutostartCode(string code) signal failedAutostartCode(string code)
signal openReleaseNotesExternally()
signal showCertIssue() signal showCertIssue()
signal updateFinished(bool hasError) signal updateFinished(bool hasError)

View File

@ -872,6 +872,11 @@ Window {
function startManualUpdate() { function startManualUpdate() {
console.log("startManualUpdate") console.log("startManualUpdate")
} }
function checkAndOpenReleaseNotes() {
console.log("check for release notes")
go.updateReleaseNotesLink = "https://protonmail.com/download/import-export/release_notes.html"
go.openReleaseNotesExternally()
}
property real progress: 0.0 property real progress: 0.0
property int progressFails: 0 property int progressFails: 0
@ -912,6 +917,8 @@ Window {
signal notifyUpdate() signal notifyUpdate()
signal updateFinished(bool hasError) signal updateFinished(bool hasError)
signal openReleaseNotesExternally()
signal notifyLogout(string accname) signal notifyLogout(string accname)
signal notifyError(int errCode) signal notifyError(int errCode)

View File

@ -422,8 +422,7 @@ func (f *FrontendQt) startManualUpdate() {
}() }()
} }
func (f *FrontendQt) checkForUpdates() { func (f *FrontendQt) checkForUpdatesAndWait() {
go func() {
version, err := f.updater.Check() version, err := f.updater.Check()
if err != nil { if err != nil {
@ -448,9 +447,19 @@ func (f *FrontendQt) checkForUpdates() {
} }
f.NotifyManualUpdate(version, true) f.NotifyManualUpdate(version, true)
}
func (s *FrontendQt) checkAndOpenReleaseNotes() {
go func() {
s.checkForUpdatesAndWait()
s.Qml.OpenReleaseNotesExternally()
}() }()
} }
func (s *FrontendQt) checkForUpdates() {
go s.checkForUpdatesAndWait()
}
func (f *FrontendQt) resetSource() { func (f *FrontendQt) resetSource() {
if f.transfer != nil { if f.transfer != nil {
f.transfer.ResetRules() f.transfer.ResetRules()

View File

@ -64,6 +64,8 @@ type GoQMLInterface struct {
_ func() `signal:"notifySilentUpdateRestartNeeded"` _ func() `signal:"notifySilentUpdateRestartNeeded"`
_ func() `signal:"notifySilentUpdateError"` _ func() `signal:"notifySilentUpdateError"`
_ func() `slot:"checkForUpdates"` _ func() `slot:"checkForUpdates"`
_ func() `slot:"checkAndOpenReleaseNotes"`
_ func() `signal:"openReleaseNotesExternally"`
_ func() `slot:"startManualUpdate"` _ func() `slot:"startManualUpdate"`
// translations // translations

View File

@ -414,8 +414,7 @@ func (s *FrontendQt) openLogs() {
go open.Run(logsPath) go open.Run(logsPath)
} }
func (s *FrontendQt) checkForUpdates() { func (s *FrontendQt) checkForUpdatesAndWait() {
go func() {
version, err := s.updater.Check() version, err := s.updater.Check()
if err != nil { if err != nil {
@ -440,9 +439,19 @@ func (s *FrontendQt) checkForUpdates() {
} }
s.NotifyManualUpdate(version, true) s.NotifyManualUpdate(version, true)
}
func (s *FrontendQt) checkAndOpenReleaseNotes() {
go func() {
s.checkForUpdatesAndWait()
s.Qml.OpenReleaseNotesExternally()
}() }()
} }
func (s *FrontendQt) checkForUpdates() {
go s.checkForUpdatesAndWait()
}
func (s *FrontendQt) openLicenseFile() { func (s *FrontendQt) openLicenseFile() {
go open.Run(s.locations.GetLicenseFilePath()) go open.Run(s.locations.GetLicenseFilePath())
} }

View File

@ -61,6 +61,8 @@ type GoQMLInterface struct {
_ func() `signal:"notifySilentUpdateRestartNeeded"` _ func() `signal:"notifySilentUpdateRestartNeeded"`
_ func() `signal:"notifySilentUpdateError"` _ func() `signal:"notifySilentUpdateError"`
_ func() `slot:"checkForUpdates"` _ func() `slot:"checkForUpdates"`
_ func() `slot:"checkAndOpenReleaseNotes"`
_ func() `signal:"openReleaseNotesExternally"`
_ func() `slot:"startManualUpdate"` _ func() `slot:"startManualUpdate"`
// Translations. // Translations.