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 -->
</application>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28"/>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
</manifest>

View file

@ -74,4 +74,8 @@ android {
minSdkVersion = qtMinSdkVersion
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
!isEmpty(target.path): INSTALLS += target
# Add version to define
DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"
HEADERS += \
headers/appsettings.h \
headers/serverconn.h
DISTFILES += \
CHANGELOG.md \
android-sources/AndroidManifest.xml \
android-sources/build.gradle \
android-sources/gradle.properties \
android-sources/gradle/wrapper/gradle-wrapper.jar \
android-sources/gradle/wrapper/gradle-wrapper.properties \
android-sources/gradlew \
android-sources/gradlew.bat \
android-sources/res/values/libs.xml
android/AndroidManifest.xml \
android/build.gradle \
android/gradle.properties \
android/gradle/wrapper/gradle-wrapper.jar \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew \
android/gradlew.bat \
android/res/values/libs.xml
android {
QT += androidextras
@ -70,10 +73,10 @@ android {
ANDROID_VERSION_NAME = $$VERSION
ANDROID_VERSION_CODE = $$droidVersionCode($$ANDROID_VERSION_NAME)
message(Android version code: $$ANDROID_VERSION_CODE)
include(/home/dorian/Android/Sdk/android_openssl/openssl.pri)
ANDROID_ABIS = armeabi-v7a arm64-v8a
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
}
ios {
@ -81,5 +84,6 @@ ios {
xcode_product_bundle_identifier_setting.value = "de.itsblue.bluerock"
}
# this has to be the last line!
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 {
fill: parent
topMargin: parent.height * 0.05
bottomMargin: parent.height * 0.1
bottomMargin: parent.height * 0.05
rightMargin: parent.width * 0.1 + 20
leftMargin: parent.width * 0.1 + 20
}
@ -54,7 +54,7 @@ Rectangle {
Layout.preferredHeight: height
Layout.preferredWidth: width
width: lockedLayout.height * 0.1
width: lockedLayout.height * 0.05
height: width
mipmap: true
@ -92,10 +92,34 @@ Rectangle {
enabled: speedFlowChartProduct.status === Product.Registered
text: speedFlowChartProduct.status === Product.Registered
? "Buy now for " + speedFlowChartProduct.price
: qsTr("this item is currently unavailable")
: qsTr("This item is currently unavailable")
icon.name: "buy"
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: ({})
// always unlock in debug mode
property bool unlocked: appSettings.read("speedBackendPurchase") === "1" || QT_DEBUG
property bool unlocked: appSettings.read("speedBackendPurchase") === "1"
state: "hidden"
@ -23,17 +23,8 @@ Rectangle {
color: Material.background
onStateChanged: {
if(state === "visible" && unlocked) {
speedFlowChartLoader.sourceComponent = speedFlowChartComponent
}
else if(state === "visible" && !unlocked) {
speedFlowChartLoader.sourceComponent = speedFlowChartLockerComponent
}
else {
speedFlowChartLoader.sourceComponent = undefined
}
}
onStateChanged: reloadState()
onUnlockedChanged: reloadState()
function toggle() {
if(control.state === "hidden"){
@ -48,14 +39,26 @@ Rectangle {
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 {
target: speedFlowChartProduct
function onPurchaseRestored() {
control.unlocked = appSettings.read("speedBackendPurchase") === "1" ? "unlocked":"locked"
control.unlocked = appSettings.read("speedBackendPurchase") === "1"
}
function onPurchaseSucceeded() {
control.unlocked = appSettings.read("speedBackendPurchase") === "1" ? "unlocked":"locked"
control.unlocked = appSettings.read("speedBackendPurchase") === "1"
}
}

View file

@ -83,18 +83,33 @@ Page {
}
ToolButton {
id: ifscDisclaimerButton
RowLayout {
anchors {
horizontalCenter: parent.horizontalCenter
bottom: bottomDigitalrockDisclaimerLabel.top
}
text: "WHERE ARE THE IFSC RESULTS?"
font.bold: true
Button {
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 {
@ -120,37 +135,23 @@ Page {
}
}
Dialog {
DisclaimerDialog {
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?"
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 {
wrapMode: Text.Wrap
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)
}
}
"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>," +
"the source code can be found <a href='https://itsblue.dev/dorian/blueROCK/'>here</a>."
}

View file

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

View file

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

View file

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