fix: unbreak ModuleWarning banners

they stopped appearing after the introduction of `localAppSettings.testEnvironment`
This commit is contained in:
Lukáš Tinkl 2023-01-30 11:42:26 +01:00 committed by Jonathan Rainville
parent 20733272f2
commit fbd936d151
2 changed files with 10 additions and 25 deletions

View File

@ -111,7 +111,7 @@ Item {
{
newVersionAvailable: available,
downloadURL: url,
currentVersion: rootStore.profileSectionStore.getCurrentVersion(),
currentVersion: appMain.rootStore.profileSectionStore.getCurrentVersion(),
newVersion: version
})
return downloadPage
@ -566,6 +566,9 @@ Item {
ColumnLayout {
id: bannersLayout
enabled: !localAppSettings.testEnvironment
visible: enabled
property var updateBanner: null
property var connectedBanner: null
readonly property bool isConnected: appMain.rootStore.mainModuleInst.isOnline
@ -762,11 +765,9 @@ Item {
onCloseClicked: {
hide();
}
onHideStarted: {
bannersLayout.connectedBanner = null
}
onHideFinished: {
destroy()
bannersLayout.connectedBanner = null
}
}
}
@ -813,11 +814,9 @@ Item {
appMain.rootStore.resetLastVersion();
hide()
}
onHideStarted: {
bannersLayout.updateBanner = null
}
onHideFinished: {
destroy()
bannersLayout.updateBanner = null
}
}
}

View File

@ -17,7 +17,7 @@ Item {
Success
}
property bool active: false
property bool active
property int type: ModuleWarning.Danger
property int progressValue: -1 // 0..100, -1 not visible
property string text: ""
@ -31,18 +31,9 @@ Item {
signal hideStarted()
signal hideFinished()
QtObject {
id: d
property bool active: false
}
function show() {
if (localAppSettings.testEnvironment) {
// Never show the banner while in a test enviornment
return
}
hideTimer.stop()
d.active = true;
active = true;
}
function showFor(duration = 5000) {
@ -61,15 +52,10 @@ Item {
signal linkActivated(string link)
implicitHeight: d.active ? content.implicitHeight : 0
implicitHeight: active ? content.implicitHeight : 0
visible: implicitHeight > 0
onActiveChanged: {
if (localAppSettings.testEnvironment) {
// Never show the banner while in a test enviornment
return
}
d.active = active
active ? showAnimation.start() : hideAnimation.start()
}
@ -110,7 +96,7 @@ Item {
repeat: false
running: false
onTriggered: {
d.active = false
root.active = false
}
}