app/resources/qml/Components/SpeedFlowChartLocker.qml

127 lines
3.6 KiB
QML
Raw Normal View History

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.15
import QtPurchasing 1.12
Rectangle {
id: speedFlowChartLockedOverlay
anchors.fill: parent
anchors.margins: -20
color: Material.background
Connections {
target: speedFlowChartProduct
function onPurchaseFailed() {
2021-06-20 20:11:19 +02:00
//% "Purchase failed"
purchaseBt.text = qsTrId("purchaseFailed")
purchaseBt.enabled = false
buttonTextResetTimer.start()
}
}
Timer {
id: buttonTextResetTimer
interval: 2000
running: false
repeat: false
onTriggered: {
purchaseBt.text = (speedFlowChartProduct.status === Product.Registered
2021-06-20 20:11:19 +02:00
//% "Buy now for"
? qsTrId("buyNowFor") + " " + speedFlowChartProduct.price
//% "This item is currently unavailable"
: qsTrId("itemUnavailable"))
purchaseBt.enabled = true
}
}
ColumnLayout {
id: lockedLayout
anchors {
fill: parent
topMargin: parent.height * 0.05
2021-06-06 21:53:41 +02:00
bottomMargin: parent.height * 0.05
rightMargin: parent.width * 0.1 + 20
leftMargin: parent.width * 0.1 + 20
}
//spacing: parent.height * 0.05
Label {
Layout.fillWidth: true
height: parent.height * 0.015
2021-06-20 20:11:19 +02:00
//% "This is a premium feature."
text: qsTrId("thisIsAPremiumFeature")
font.bold: true
font.pixelSize: height
fontSizeMode: Text.Fit
minimumPixelSize: 1
horizontalAlignment: Text.AlignHCenter
}
SwipeGallery {
property string platformIcons: Qt.platform.os === "osx" || Qt.platform.os === "iso" ? "ios":"android"
Layout.fillHeight: true
Layout.fillWidth: true
images: [
"qrc:/screenshots/SpeedFlowchartDemo/" + platformIcons + "/1.jpeg",
"qrc:/screenshots/SpeedFlowchartDemo/" + platformIcons + "/2.jpeg",
"qrc:/screenshots/SpeedFlowchartDemo/" + platformIcons + "/3.jpeg"
]
}
Button {
id: purchaseBt
Layout.alignment: Layout.Center
enabled: speedFlowChartProduct.status === Product.Registered
text: speedFlowChartProduct.status === Product.Registered
2021-06-20 20:11:19 +02:00
? "\uf218 "+ qsTrId("buyNowFor") +" " + speedFlowChartProduct.price
//% "This item is currently unavailable"
: qsTrId("itemIsUnavailable")
font.family: fa5solid.name
onClicked: speedFlowChartProduct.purchase()
}
2021-06-06 21:53:41 +02:00
RowLayout {
Layout.alignment: Layout.Center
2021-06-20 20:11:19 +02:00
Button {
id: restorePurchaseButton
Layout.alignment: Layout.Center
visible: speedFlowChartProduct.status === Product.Registered
2021-06-06 21:53:41 +02:00
2021-06-20 20:11:19 +02:00
flat: true
//% "Restore purchase"
text: qsTrId("restorePurchase")
2021-06-06 21:53:41 +02:00
2021-06-20 20:11:19 +02:00
onClicked: inAppProductStore.restorePurchases()
}
2021-06-06 21:53:41 +02:00
2021-06-20 20:11:19 +02:00
Button {
id: contactSupportButton
Layout.alignment: Layout.Center
2021-06-06 21:53:41 +02:00
2021-06-20 20:11:19 +02:00
flat: true
//% "contact support"
text: qsTrId("contact support")
2021-06-06 21:53:41 +02:00
2021-06-20 20:11:19 +02:00
onClicked: Qt.openUrlExternally("mailto:contact@itsblue.de")
}
2021-06-06 21:53:41 +02:00
}
}
}