mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 14:56:42 +00:00
GODT-1458: Splash screen and wording.
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user