some more minor adjustments

This commit is contained in:
Dorian Zedler 2021-06-06 21:53:41 +02:00
parent f9f6dd7f5d
commit f4aa3deaec
Signed by: dorian
GPG key ID: 989DE36109AFA354
19 changed files with 160 additions and 62 deletions

View file

@ -72,5 +72,5 @@
<!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices --> <!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
</application> </application>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28"/> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
</manifest> </manifest>

View file

@ -74,4 +74,8 @@ android {
minSdkVersion = qtMinSdkVersion minSdkVersion = qtMinSdkVersion
targetSdkVersion = qtTargetSdkVersion targetSdkVersion = qtTargetSdkVersion
} }
lintOptions {
checkReleaseBuilds false
}
} }

View file

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View file

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View file

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View file

@ -37,20 +37,23 @@ qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target !isEmpty(target.path): INSTALLS += target
# Add version to define
DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"
HEADERS += \ HEADERS += \
headers/appsettings.h \ headers/appsettings.h \
headers/serverconn.h headers/serverconn.h
DISTFILES += \ DISTFILES += \
CHANGELOG.md \ CHANGELOG.md \
android-sources/AndroidManifest.xml \ android/AndroidManifest.xml \
android-sources/build.gradle \ android/build.gradle \
android-sources/gradle.properties \ android/gradle.properties \
android-sources/gradle/wrapper/gradle-wrapper.jar \ android/gradle/wrapper/gradle-wrapper.jar \
android-sources/gradle/wrapper/gradle-wrapper.properties \ android/gradle/wrapper/gradle-wrapper.properties \
android-sources/gradlew \ android/gradlew \
android-sources/gradlew.bat \ android/gradlew.bat \
android-sources/res/values/libs.xml android/res/values/libs.xml
android { android {
QT += androidextras QT += androidextras
@ -70,10 +73,10 @@ android {
ANDROID_VERSION_NAME = $$VERSION ANDROID_VERSION_NAME = $$VERSION
ANDROID_VERSION_CODE = $$droidVersionCode($$ANDROID_VERSION_NAME) ANDROID_VERSION_CODE = $$droidVersionCode($$ANDROID_VERSION_NAME)
message(Android version code: $$ANDROID_VERSION_CODE)
include(/home/dorian/Android/Sdk/android_openssl/openssl.pri) include(/home/dorian/Android/Sdk/android_openssl/openssl.pri)
ANDROID_ABIS = armeabi-v7a arm64-v8a ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources
} }
ios { ios {
@ -81,5 +84,6 @@ ios {
xcode_product_bundle_identifier_setting.value = "de.itsblue.bluerock" xcode_product_bundle_identifier_setting.value = "de.itsblue.bluerock"
} }
# this has to be the last line!
ANDROID_ABIS = armeabi-v7a arm64-v8a ANDROID_ABIS = armeabi-v7a arm64-v8a

View file

@ -0,0 +1,53 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15
Dialog {
id: control
title: ""
property string content: ""
parent: Overlay.overlay
x: (parent.width - width) * 0.5
y: (parent.height - height) * 0.5
width: parent.width * 0.8
height: implicitHeight
modal: true
standardButtons: Dialog.Close
header: Label {
text: control.title
visible: control.title
elide: Label.ElideRight
padding: 24
bottomPadding: 0
font.bold: true
font.pixelSize: 16
background: Rectangle {
radius: 2
color: control.Material.dialogColor
clip: true
}
onLinkActivated: {
Qt.openUrlExternally(link)
}
}
contentItem: Label {
wrapMode: Text.Wrap
width: control.width * 0.8
height: implicitHeight
text: control.content
onLinkActivated: {
Qt.openUrlExternally(link)
}
}
}

View file

@ -40,7 +40,7 @@ Rectangle {
anchors { anchors {
fill: parent fill: parent
topMargin: parent.height * 0.05 topMargin: parent.height * 0.05
bottomMargin: parent.height * 0.1 bottomMargin: parent.height * 0.05
rightMargin: parent.width * 0.1 + 20 rightMargin: parent.width * 0.1 + 20
leftMargin: parent.width * 0.1 + 20 leftMargin: parent.width * 0.1 + 20
} }
@ -54,7 +54,7 @@ Rectangle {
Layout.preferredHeight: height Layout.preferredHeight: height
Layout.preferredWidth: width Layout.preferredWidth: width
width: lockedLayout.height * 0.1 width: lockedLayout.height * 0.05
height: width height: width
mipmap: true mipmap: true
@ -92,10 +92,34 @@ Rectangle {
enabled: speedFlowChartProduct.status === Product.Registered enabled: speedFlowChartProduct.status === Product.Registered
text: speedFlowChartProduct.status === Product.Registered text: speedFlowChartProduct.status === Product.Registered
? "Buy now for " + speedFlowChartProduct.price ? "Buy now for " + speedFlowChartProduct.price
: qsTr("this item is currently unavailable") : qsTr("This item is currently unavailable")
icon.name: "buy" icon.name: "buy"
onClicked: speedFlowChartProduct.purchase() onClicked: speedFlowChartProduct.purchase()
} }
RowLayout {
Button {
id: restorePurchaseButton
Layout.alignment: Layout.Center
visible: speedFlowChartProduct.status === Product.Registered
flat: true
text: "restore purchase"
onClicked: inAppProductStore.restorePurchases()
}
Button {
id: contactSupportButton
Layout.alignment: Layout.Center
flat: true
text: "contact support"
onClicked: Qt.openUrlExternally("mailto:contact@itsblue.de")
}
}
} }
} }

View file

@ -8,7 +8,7 @@ Rectangle {
property var flowchartData: ({}) property var flowchartData: ({})
// always unlock in debug mode // always unlock in debug mode
property bool unlocked: appSettings.read("speedBackendPurchase") === "1" || QT_DEBUG property bool unlocked: appSettings.read("speedBackendPurchase") === "1"
state: "hidden" state: "hidden"
@ -23,17 +23,8 @@ Rectangle {
color: Material.background color: Material.background
onStateChanged: { onStateChanged: reloadState()
if(state === "visible" && unlocked) { onUnlockedChanged: reloadState()
speedFlowChartLoader.sourceComponent = speedFlowChartComponent
}
else if(state === "visible" && !unlocked) {
speedFlowChartLoader.sourceComponent = speedFlowChartLockerComponent
}
else {
speedFlowChartLoader.sourceComponent = undefined
}
}
function toggle() { function toggle() {
if(control.state === "hidden"){ if(control.state === "hidden"){
@ -48,14 +39,26 @@ Rectangle {
return control.state === "visible" return control.state === "visible"
} }
function reloadState() {
if(state === "visible" && unlocked) {
speedFlowChartLoader.sourceComponent = speedFlowChartComponent
}
else if(state === "visible" && !unlocked) {
speedFlowChartLoader.sourceComponent = speedFlowChartLockerComponent
}
else {
speedFlowChartLoader.sourceComponent = undefined
}
}
Connections { Connections {
target: speedFlowChartProduct target: speedFlowChartProduct
function onPurchaseRestored() { function onPurchaseRestored() {
control.unlocked = appSettings.read("speedBackendPurchase") === "1" ? "unlocked":"locked" control.unlocked = appSettings.read("speedBackendPurchase") === "1"
} }
function onPurchaseSucceeded() { function onPurchaseSucceeded() {
control.unlocked = appSettings.read("speedBackendPurchase") === "1" ? "unlocked":"locked" control.unlocked = appSettings.read("speedBackendPurchase") === "1"
} }
} }

View file

@ -83,18 +83,33 @@ Page {
} }
ToolButton { RowLayout {
id: ifscDisclaimerButton
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
bottom: bottomDigitalrockDisclaimerLabel.top bottom: bottomDigitalrockDisclaimerLabel.top
} }
text: "WHERE ARE THE IFSC RESULTS?" Button {
font.bold: true id: ifscDisclaimerButton
onClicked: ifscDisclaimerDialog.open() flat: true
font.bold: true
font.pixelSize: 15
text: "Where are the IFSC results?"
onClicked: ifscDisclaimerDialog.open()
}
Button {
flat: true
font.pixelSize: 15
text: "About blueROCK"
onClicked: aboutBluerockDisclaimerDialog.open()
}
} }
Label { Label {
@ -120,37 +135,23 @@ Page {
} }
} }
Dialog {
DisclaimerDialog {
id: ifscDisclaimerDialog id: ifscDisclaimerDialog
parent: Overlay.overlay
x: (parent.width - width) * 0.5
y: (parent.height - height) * 0.5
width: parent.width * 0.8
height: implicitHeight
title: "Where are the IFSC results?" title: "Where are the IFSC results?"
modal: true content: "Unfortunately, the IFSC has restricted the access to their data and <b>is not willing to share results with blueROCK anymore</b>. " +
"Because of this, blueROCK is no longer able to access and display IFSC results.<br><br>" +
"You can find current IFSC results <a href=\"https://ifsc.results.info\">over here</a> and on <a href=\"https://ifsc-climbing.org\">their website</a>."
}
standardButtons: Dialog.Close DisclaimerDialog {
id: aboutBluerockDisclaimerDialog
title: "blueROCK v" + APP_VERSION + "<br>By <a href=\"https://itsblue.de\">Itsblue Development</a>"
content: "This app was built using the <a href='https://qt.io'>Qt Framework</a> " +
"licensed under the <a href='https://www.gnu.org/licenses/lgpl-3.0.en.html'>GNU lgplV3 license</a>.<br><br>"+
contentItem: Label { "This app is open source and licensed under the <a href='https://www.gnu.org/licenses/agpl-3.0.en.html'>GNU agplV3 license</a>," +
wrapMode: Text.Wrap "the source code can be found <a href='https://itsblue.dev/dorian/blueROCK/'>here</a>."
width: ifscDisclaimerDialog.width * 0.8
height: implicitHeight
text:
"Unfortunately, the IFSC has restricted the access to their data and <b>is not willing to share results with blueROCK anymore</b>. " +
"Because of this, blueROCK is no longer able to access and display IFSC results.<br><br>" +
"You can find current IFSC results <a href=\"https://ifsc.results.info\">over here</a> and on <a href=\"https://ifsc-climbing.org\">their website</a>."
onLinkActivated: {
Qt.openUrlExternally(link)
}
}
} }

View file

@ -478,9 +478,15 @@ Window {
} }
Store { Store {
id: inAppProductStore
Product { Product {
id: speedFlowChartProduct id: speedFlowChartProduct
identifier: "speed_flowchart" //identifier: "speed_flowchart"
identifier: "android.test.purchased"
//identifier: "android.test.canceled"
//identifier: "android.test.refunded"
type: Product.Unlockable type: Product.Unlockable
onPurchaseRestored: { onPurchaseRestored: {

View file

@ -25,5 +25,6 @@
<file>Components/SpeedFlowChartLocker.qml</file> <file>Components/SpeedFlowChartLocker.qml</file>
<file>Components/SpeedFlowChartPopup.qml</file> <file>Components/SpeedFlowChartPopup.qml</file>
<file>Components/BlueRockBadge.qml</file> <file>Components/BlueRockBadge.qml</file>
<file>Components/DisclaimerDialog.qml</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -48,6 +48,8 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("QT_DEBUG", false); engine.rootContext()->setContextProperty("QT_DEBUG", false);
#endif #endif
engine.rootContext()->setContextProperty("APP_VERSION", APP_VERSION);
engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty()) if (engine.rootObjects().isEmpty())
return -1; return -1;