app/resources/qml/Components/SpeedFlowChartLocker.qml

132 lines
4.1 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
2021-07-05 20:55:34 +02:00
Page {
id: control
anchors.fill: parent
Connections {
target: speedFlowChartProduct
function onPurchaseFailed() {
2021-06-20 20:11:19 +02:00
//% "Purchase failed"
2021-06-20 21:08:59 +02:00
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"
2021-06-20 21:08:59 +02:00
? qsTrId("#buyNowFor") + " " + speedFlowChartProduct.price
2021-06-20 20:11:19 +02:00
//% "This item is currently unavailable"
2021-06-20 21:08:59 +02:00
: qsTrId("#itemIsUnavailable"))
purchaseBt.enabled = true
}
}
2021-07-05 20:55:34 +02:00
Column {
id: lockedLayout
anchors {
fill: parent
2021-07-05 20:55:34 +02:00
topMargin: parent.height * 0.02
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
}
2021-07-05 20:55:34 +02:00
spacing: lockedLayout.height * 0.01
Label {
2021-07-05 20:55:34 +02:00
anchors.horizontalCenter: parent.horizontalCenter
height: lockedLayout.height * 0.03
width: lockedLayout.width
2021-06-20 20:11:19 +02:00
//% "This is a premium feature."
2021-06-20 21:08:59 +02:00
text: qsTrId("#thisIsAPremiumFeature")
font.pixelSize: height
2021-07-05 20:55:34 +02:00
font.bold: true
fontSizeMode: Text.Fit
horizontalAlignment: Text.AlignHCenter
2021-07-05 20:55:34 +02:00
verticalAlignment: Text.AlignVCenter
2021-07-05 20:55:34 +02:00
minimumPixelSize: 1
}
SwipeGallery {
property string platformIcons: Qt.platform.os === "osx" || Qt.platform.os === "iso" ? "ios":"android"
2021-07-05 20:55:34 +02:00
height: lockedLayout.height * 0.85
width: lockedLayout.width
images: [
"qrc:/screenshots/SpeedFlowchartDemo/" + platformIcons + "/1.jpeg",
"qrc:/screenshots/SpeedFlowchartDemo/" + platformIcons + "/2.jpeg",
"qrc:/screenshots/SpeedFlowchartDemo/" + platformIcons + "/3.jpeg"
]
}
Button {
id: purchaseBt
2021-07-05 20:55:34 +02:00
anchors.horizontalCenter: parent.horizontalCenter
height: lockedLayout.height * 0.07
enabled: speedFlowChartProduct.status === Product.Registered
text: speedFlowChartProduct.status === Product.Registered
2021-07-05 20:55:34 +02:00
? "\uf218 "+ qsTrId("#buyNowFor") + " " + speedFlowChartProduct.price
2021-06-20 21:08:59 +02:00
: qsTrId("#itemIsUnavailable")
font.family: fa5solid.name
2021-07-05 20:55:34 +02:00
font.pixelSize: height * 0.4
font.capitalization: Font.MixedCase
onClicked: speedFlowChartProduct.purchase()
}
2021-06-06 21:53:41 +02:00
RowLayout {
2021-07-05 20:55:34 +02:00
id: bottomRow
2021-06-06 21:53:41 +02:00
2021-07-05 20:55:34 +02:00
anchors.horizontalCenter: parent.horizontalCenter
height: lockedLayout.height * 0.065
2021-06-20 20:11:19 +02:00
Button {
id: restorePurchaseButton
Layout.alignment: Layout.Center
2021-07-05 20:55:34 +02:00
Layout.preferredHeight: bottomRow.height
//visible: speedFlowChartProduct.status === Product.Registered
2021-06-06 21:53:41 +02:00
2021-06-20 20:11:19 +02:00
flat: true
2021-07-05 20:55:34 +02:00
font.pixelSize: height * 0.4
font.capitalization: Font.MixedCase
2021-06-20 20:11:19 +02:00
//% "Restore purchase"
2021-06-20 21:08:59 +02:00
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-07-05 20:55:34 +02:00
Layout.preferredHeight: bottomRow.height
2021-06-06 21:53:41 +02:00
2021-06-20 20:11:19 +02:00
flat: true
2021-07-05 20:55:34 +02:00
font.pixelSize: height * 0.4
font.capitalization: Font.MixedCase
2021-06-20 20:11:19 +02:00
//% "contact support"
2021-06-20 21:08:59 +02:00
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
}
}
}