GODT-1458: Splash screen and wording.

This commit is contained in:
Jakub
2021-12-09 11:50:42 +01:00
committed by Jakub Cuth
parent ad6b84d4e0
commit f0d05aeb79
12 changed files with 289 additions and 14 deletions

View File

@ -25,6 +25,7 @@ import (
"os"
"runtime"
"github.com/Masterminds/semver/v3"
qmlLog "github.com/ProtonMail/proton-bridge/internal/frontend/qt/log"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/qml"
@ -94,3 +95,25 @@ func (f *FrontendQt) initiateQtApplication() error {
return nil
}
func (f *FrontendQt) setShowSplashScreen() {
f.qml.SetShowSplashScreen(false)
// Splash screen should not be shown to new users or after factory reset.
if f.bridge.IsFirstStart() {
return
}
ver, err := semver.NewVersion(f.bridge.GetLastVersion())
if err != nil {
f.log.WithError(err).WithField("last", f.bridge.GetLastVersion()).Debug("Cannot parse last version")
return
}
// Current splash screen contains update on "What's new" in facelift.
// Therefore, it should be shown only if the last used version was less
// than 1.9.0.
if ver.LessThan(semver.MustParse("1.9.0")) {
f.qml.SetShowSplashScreen(true)
}
}

View File

@ -43,6 +43,7 @@ type QMLBackend struct {
_ func() `slot:"restart"`
_ bool `property:showOnStartup`
_ bool `property:showSplashScreen`
_ bool `property:dockIconVisible`
@ -255,6 +256,7 @@ func (q *QMLBackend) setup(f *FrontendQt) {
}()
})
f.setShowSplashScreen()
f.setVersion()
f.setLogsPath()
// release notes link is set by update