diff --git a/android-sources/AndroidManifest.xml b/android-sources/AndroidManifest.xml index 999e16e..650953d 100644 --- a/android-sources/AndroidManifest.xml +++ b/android-sources/AndroidManifest.xml @@ -1,44 +1,54 @@ - - - + + + + + + + + + + - - - + - - - + - + - - - + + + + - + + + - - - - + - - - - + + - - - - - - - - - - - - - + diff --git a/android-sources/build.gradle b/android-sources/build.gradle new file mode 100644 index 0000000..443a800 --- /dev/null +++ b/android-sources/build.gradle @@ -0,0 +1,77 @@ +buildscript { + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.6.0' + } +} + +repositories { + google() + jcenter() +} + +apply plugin: 'com.android.application' + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) +} + +android { + /******************************************************* + * The following variables: + * - androidBuildToolsVersion, + * - androidCompileSdkVersion + * - qt5AndroidDir - holds the path to qt android files + * needed to build any Qt application + * on Android. + * + * are defined in gradle.properties file. This file is + * updated by QtCreator and androiddeployqt tools. + * Changing them manually might break the compilation! + *******************************************************/ + + compileSdkVersion androidCompileSdkVersion.toInteger() + + buildToolsVersion '28.0.3' + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] + aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] + res.srcDirs = [qt5AndroidDir + '/res', 'res'] + resources.srcDirs = ['resources'] + renderscript.srcDirs = ['src'] + assets.srcDirs = ['assets'] + jniLibs.srcDirs = ['libs'] + } + } + + tasks.withType(JavaCompile) { + options.incremental = true + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + lintOptions { + abortOnError false + } + + // Do not compress Qt binary resources file + aaptOptions { + noCompress 'rcc' + } + + defaultConfig { + resConfig "en" + minSdkVersion = qtMinSdkVersion + targetSdkVersion = qtTargetSdkVersion + } +} diff --git a/android-sources/gradle.properties b/android-sources/gradle.properties new file mode 100644 index 0000000..fded106 --- /dev/null +++ b/android-sources/gradle.properties @@ -0,0 +1,11 @@ +# Project-wide Gradle settings. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m + +# Gradle caching allows reusing the build artifacts from a previous +# build with the same inputs. However, over time, the cache size will +# grow. Uncomment the following line to enable it. +#org.gradle.caching=true diff --git a/android-sources/gradle/wrapper/gradle-wrapper.jar b/android-sources/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..f6b961f Binary files /dev/null and b/android-sources/gradle/wrapper/gradle-wrapper.jar differ diff --git a/android-sources/gradle/wrapper/gradle-wrapper.properties b/android-sources/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..5028f28 --- /dev/null +++ b/android-sources/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/android-sources/gradlew b/android-sources/gradlew new file mode 100755 index 0000000..cccdd3d --- /dev/null +++ b/android-sources/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/android-sources/gradlew.bat b/android-sources/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/android-sources/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/android-sources/libs/archived/libcrypto.so b/android-sources/libs/archived/libcrypto.so deleted file mode 100644 index 4448d85..0000000 Binary files a/android-sources/libs/archived/libcrypto.so and /dev/null differ diff --git a/android-sources/libs/archived/libssl.so b/android-sources/libs/archived/libssl.so deleted file mode 100644 index e8ef374..0000000 Binary files a/android-sources/libs/archived/libssl.so and /dev/null differ diff --git a/android-sources/libs/armeabi-v7a/libcrypto.so b/android-sources/libs/armeabi-v7a/libcrypto.so deleted file mode 100644 index 4511f70..0000000 Binary files a/android-sources/libs/armeabi-v7a/libcrypto.so and /dev/null differ diff --git a/android-sources/libs/armeabi-v7a/libssl.so b/android-sources/libs/armeabi-v7a/libssl.so deleted file mode 100644 index 4101bbf..0000000 Binary files a/android-sources/libs/armeabi-v7a/libssl.so and /dev/null differ diff --git a/android-sources/libs/x86/libcrypto.so b/android-sources/libs/x86/libcrypto.so deleted file mode 100644 index a2e46cd..0000000 Binary files a/android-sources/libs/x86/libcrypto.so and /dev/null differ diff --git a/android-sources/libs/x86/libssl.so b/android-sources/libs/x86/libssl.so deleted file mode 100644 index 3f3032a..0000000 Binary files a/android-sources/libs/x86/libssl.so and /dev/null differ diff --git a/android-sources/res/drawable-hdpi/icon.png b/android-sources/res/drawable-hdpi/icon.png index 159d958..a228a59 100644 Binary files a/android-sources/res/drawable-hdpi/icon.png and b/android-sources/res/drawable-hdpi/icon.png differ diff --git a/android-sources/res/drawable-ldpi/icon.png b/android-sources/res/drawable-ldpi/icon.png index 159d958..a228a59 100644 Binary files a/android-sources/res/drawable-ldpi/icon.png and b/android-sources/res/drawable-ldpi/icon.png differ diff --git a/android-sources/res/drawable-mdpi/icon.png b/android-sources/res/drawable-mdpi/icon.png index 159d958..a228a59 100644 Binary files a/android-sources/res/drawable-mdpi/icon.png and b/android-sources/res/drawable-mdpi/icon.png differ diff --git a/android-sources/res/values/libs.xml b/android-sources/res/values/libs.xml new file mode 100644 index 0000000..6b1a4a2 --- /dev/null +++ b/android-sources/res/values/libs.xml @@ -0,0 +1,22 @@ + + + + https://download.qt.io/ministro/android/qt5/qt-5.14 + + + + + + + + + + + + + + + + + diff --git a/blueROCK.pro b/blueROCK.pro index e69c9c3..b5292dd 100644 --- a/blueROCK.pro +++ b/blueROCK.pro @@ -2,16 +2,7 @@ QT += quick qml quickcontrols2 purchasing widgets CONFIG += c++11 VERSION = 0.04 - -android { - QT += androidextras - ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources -} - -ios { - QMAKE_ASSET_CATALOGS += resources/shared/Assets.xcassets - xcode_product_bundle_identifier_setting.value = "de.itsblue.bluerock" -} +TARGET = blueROCK # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings @@ -53,5 +44,44 @@ HEADERS += \ 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 \ resources/shared/icons/bluerock/index.theme \ $$files(resources/shared/icons/*.png, true) + +android { + QT += androidextras + + defineReplace(droidVersionCode) { + segments = $$split(1, ".") + for (segment, segments): vCode = "$$first(vCode)$$format_number($$segment, width=3 zeropad)" + + contains(ANDROID_TARGET_ARCH, arm64-v8a): \ + suffix = 1 + else:contains(ANDROID_TARGET_ARCH, armeabi-v7a): \ + suffix = 0 + # add more cases as needed + + return($$first(vCode)$$first(suffix)) + } + + ANDROID_VERSION_NAME = $$VERSION + ANDROID_VERSION_CODE = $$droidVersionCode($$ANDROID_VERSION_NAME) + + include(/home/dorian/Android/Sdk/android_openssl/openssl.pri) + ANDROID_ABIS = armeabi-v7a arm64-v8a + ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources +} + +ios { + QMAKE_ASSET_CATALOGS += resources/shared/Assets.xcassets + xcode_product_bundle_identifier_setting.value = "de.itsblue.bluerock" +} + +ANDROID_ABIS = armeabi-v7a arm64-v8a + diff --git a/headers/appsettings.h b/headers/appsettings.h index 7c31ddc..9b92aba 100644 --- a/headers/appsettings.h +++ b/headers/appsettings.h @@ -10,34 +10,32 @@ class AppSettings : public QObject { Q_OBJECT - Q_PROPERTY(NOTIFY themeChanged) - public: explicit AppSettings(QObject *parent = nullptr); - // This is the Constructor of the AppSettings class + // This is the Constructor of the AppSettings class ~AppSettings(); - // This is the Destructor of the AppSettings class + // This is the Destructor of the AppSettings class private: QSettings *settingsManager; - // QSettings object which cares about our settings.ini file + // QSettings object which cares about our settings.ini file QSettings *themeSettingsManager; - // QSettings object which cares about the themes + // QSettings object which cares about the themes signals: void themeChanged(); public slots: Q_INVOKABLE QString read(const QString &key); - // function to read values from the settings file + // function to read values from the settings file Q_INVOKABLE void write(const QString &key, const QVariant &value); - // function to write values to the settings file + // function to write values to the settings file Q_INVOKABLE void setDefault(const QString &key, const QVariant &defaultValue); - // function to create a key (/ setting) with a default value if it hasnt been ceated yet + // function to create a key (/ setting) with a default value if it hasnt been ceated yet }; #endif // APPSETTINGS_H diff --git a/resources/qml/Components/CompetitionCalendarDelegate.qml b/resources/qml/Components/CompetitionCalendarDelegate.qml new file mode 100644 index 0000000..4d108ff --- /dev/null +++ b/resources/qml/Components/CompetitionCalendarDelegate.qml @@ -0,0 +1,169 @@ +import QtQuick 2.9 +import QtQuick.Controls 2.4 +import QtQuick.Layouts 1.3 + +ItemDelegate { + id: competitionDel + + property bool over + property var thisData: control.widgetData["competitions"][index] + + property string name: thisData["name"] + property string date: thisData["date_span"] + property var cats: thisData["cats"] + property int catId: thisData["cat_id"] === undefined ? 0:thisData["cat_id"] + + property bool thisIsFavored: control.compFavorites.indexOf(parseInt(thisData['WetId'])) >= 0 + property bool includedByFavorites: control.displayedCompCats.indexOf(-1) >= 0 && thisIsFavored + property bool includedByFilter: control.displayedCompCats.indexOf(parseInt(thisData['cat_id'])) >= 0 + property bool thisIsVisible: includedByFavorites || includedByFilter + + function updateVisibility() { + competitionDel.includedByFilter = control.displayedCompCats.indexOf(parseInt(competitionDel.thisData['cat_id'])) >= 0 + competitionDel.thisIsFavored = control.compFavorites.indexOf(parseInt(thisData['WetId'])) >= 0 + competitionDel.includedByFavorites = control.displayedCompCats.indexOf(-1) >= 0 && thisIsFavored + } + + width: control.width + height: thisIsVisible ? compDelCol.height + 10 : 0 + + enabled: ((thisData["cats"] !== undefined && thisData["cats"].length > 0) || competitionDel.thisData["homepage"] !== undefined || getCompInfoUrls(index).length > 0) && height > 0 + //visible: includedByFilter + + opacity: 0 + scale: 0.9 + + Connections { + target: control + function onDisplayedCompCatsChanged() { + competitionDel.updateVisibility() + } + + function onCompFavoritesChanged() { + competitionDel.updateVisibility() + } + } + + onThisDataChanged: { + if(thisIsVisible){ + fadeInPa.start() + } + } + + onThisIsVisibleChanged: { + if(thisIsVisible){ + fadeInPa.start() + } + else { + fadeOutPa.start() + } + } + + Behavior on height { + NumberAnimation { + duration: 400 + } + } + + onClicked: { + control.openComp(index) + } + + ParallelAnimation { + id: fadeInPa + NumberAnimation { target: competitionDel; property: "opacity"; from: 0; to: 1.0; duration: 400 } + NumberAnimation { target: competitionDel; property: "scale"; from: 0.8; to: 1.0; duration: 400 } + } + + ParallelAnimation { + id: fadeOutPa + NumberAnimation { target: competitionDel; property: "opacity"; from: 1; to: 0; duration: 400 } + NumberAnimation { target: competitionDel; property: "scale"; from: 1; to: 0.8; duration: 400 } + } + + Rectangle { + id: delBackroundRect + + anchors.fill: parent + + opacity: 0.5 + + color: control.getCompCatData(catId) === undefined ? "white":control.getCompCatData(catId)["bgcolor"] + } + + Column { + id: compDelCol + + anchors.centerIn: parent + + width: parent.width * 0.97 + + spacing: 10 + + RowLayout { + width: parent.width + Label { + id: nameLa + + width: parent.width + Layout.fillWidth: true + + font.bold: true + wrapMode: Text.WordWrap + + text: name + + } + + ToolButton { + id: bookmarkTb + icon.name: competitionDel.thisIsFavored ? "pinFilled":"pin" + onClicked: { + control.editFavorites(!competitionDel.thisIsFavored, parseInt(thisData['WetId'])) + } + + Layout.alignment: Layout.Right + + Behavior on icon.name { + SequentialAnimation { + NumberAnimation { + property: "scale" + target: bookmarkTb + duration: 75 + to: 0.8 + } + NumberAnimation { + property: "scale" + target: bookmarkTb + duration: 75 + to: 1 + } + } + } + } + } + + Label { + id: dateLa + + color: "grey" + + text: date + } + } + + Rectangle { + id: bottomLineRa + + anchors { + bottom: parent.bottom + left: parent.left + right: parent.right + } + + height: 1 + + color: "lightgrey" + + } +} diff --git a/resources/qml/Components/FancyButton.qml b/resources/qml/Components/FancyButton.qml index ce20aee..69b53ef 100644 --- a/resources/qml/Components/FancyButton.qml +++ b/resources/qml/Components/FancyButton.qml @@ -26,11 +26,11 @@ ToolButton { property string image property color backgroundColor: "white" property color textColor: "black" - property real imageScale: 1 + property real imageScale: 1.3 property double glowRadius: 0.001 property double glowSpread: 0.2 property bool glowVisible: true - property double glowScale: 0.75 + property double glowScale: 0.92 property double glowOpacity: 1 Behavior on backgroundColor { @@ -65,7 +65,7 @@ ToolButton { anchors.fill: parent - radius: height * 0.5 + radius: height * 0.2 color: control.down ? Qt.darker(control.backgroundColor, 1.03) : control.backgroundColor diff --git a/resources/qml/Components/PullRefresher.qml b/resources/qml/Components/PullRefresher.qml index e252bee..be01b9c 100644 --- a/resources/qml/Components/PullRefresher.qml +++ b/resources/qml/Components/PullRefresher.qml @@ -162,7 +162,7 @@ Item { Connections { target: control.target - onDragEnded: { + function onDragEnded(userPosition) { if(userPosition >= control.dragOutPosition * control.dragRefreshPositionMultiplier){ control.state = "refreshing" preRefreshTimer.start() diff --git a/resources/qml/Pages/StartPage.qml b/resources/qml/Pages/StartPage.qml index 58779c4..faa3c70 100644 --- a/resources/qml/Pages/StartPage.qml +++ b/resources/qml/Pages/StartPage.qml @@ -16,8 +16,9 @@ along with this program. If not, see . */ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Controls 2.4 +import QtQuick.Layouts 1.0 import "../Components" @@ -25,19 +26,42 @@ Page { id: root title: "start" - property Component headerComponent: null - Label { + signal headerComponentChanged() + + RowLayout { + id: headerLayout + anchors { horizontalCenter: parent.horizontalCenter top: parent.top topMargin: root.height * 0.03 } - font.pixelSize: anchors.topMargin - font.bold: true + height: menuGr.buttonSize * 0.3 + spacing: anchors.topMargin * 0.5 - text: "blueROCK" + Image { + Layout.preferredHeight: parent.height + Layout.preferredWidth: height + + fillMode: Image.PreserveAspectFit + mipmap: true + + source: "qrc:/icons/blueRockHold.png" + } + + Label { + Layout.preferredHeight: parent.height + Layout.fillWidth: true + + font.pixelSize: parent.height * 0.6 + font.bold: true + + verticalAlignment: Text.AlignVCenter + + text: "blueROCK" + } } Grid { @@ -45,27 +69,13 @@ Page { anchors.centerIn: parent - rows: app.landscape() ? 1:3 - columns: app.landscape() ? 3:1 + rows: app.landscape() ? 1:2 + columns: app.landscape() ? 2:1 spacing: !app.landscape() ? parent.height * 0.08:parent.width * 0.1 property int buttonSize: app.landscape() ? parent.width * 0.2:parent.height * 0.2 - FancyButton { - id: ifscBt - - height: menuGr.buttonSize - width: height - - image: "qrc:/icons/ifsc.png" - - onClicked: { - app.openWidget({nation:"ICC"}) - } - - } - FancyButton { id: davBt @@ -96,17 +106,34 @@ Page { } + ToolButton { + id: ifscDisclaimerButton + + anchors { + horizontalCenter: parent.horizontalCenter + bottom: bottomDigitalrockDisclaimerLabel.top + } + + text: "WHERE ARE THE IFSC RESULTS?" + font.bold: true + + onClicked: ifscDisclaimerDialog.open() + } + Label { + id: bottomDigitalrockDisclaimerLabel anchors { horizontalCenter: parent.horizontalCenter bottom: parent.bottom - bottomMargin: root.height * 0.03 + bottomMargin: headerLayout.anchors.topMargin } width: parent.width * 0.9 height: anchors.bottomMargin - wrapMode: "Wrap" + fontSizeMode: Label.Fit + minimumPixelSize: 1 + horizontalAlignment: Text.AlignHCenter text: "Resultservice and rankings provided by digital ROCK." @@ -116,4 +143,34 @@ Page { } } + Dialog { + 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 + + standardButtons: Dialog.Close + + contentItem: Label { + wrapMode: Text.Wrap + text: + "Unfortunately, the IFSC has restricted the access to their data and is not willing to share results with blueROCK anymore. " + + "Because of this, blueROCK is no longer able to access and display IFSC results.

" + + "You can find current IFSC results over here and on their website." + + onLinkActivated: { + Qt.openUrlExternally(link) + } + } + + } + } diff --git a/resources/qml/Widgets/CalendarWidget.qml b/resources/qml/Widgets/CalendarWidget.qml index 56c9c52..7f0c6a7 100644 --- a/resources/qml/Widgets/CalendarWidget.qml +++ b/resources/qml/Widgets/CalendarWidget.qml @@ -31,8 +31,6 @@ DataListView { property Component headerComponent: RowLayout { height: parent.height - //width: 10//childrenRect.width - spacing: 0 ToolButton { @@ -369,9 +367,8 @@ DataListView { Connections { target: parent.selector - onSelectionFinished: { + function onSelectionFinished(index, data) { if(data.comp !== undefined){ - //console.log(data.status) app.openWidget({comp: data.comp, cat: data.cat, type:data.status === 4 ? 'starters':''}) } else if(data.year !== undefined){ @@ -399,171 +396,7 @@ DataListView { height: 10 } - delegate: ItemDelegate { - id: competitionDel - - property bool over - property var thisData: control.widgetData["competitions"][index] - - property string name: thisData["name"] - property string date: thisData["date_span"] - property var cats: thisData["cats"] - property int catId: thisData["cat_id"] === undefined ? 0:thisData["cat_id"] - - property bool thisIsFavored: control.compFavorites.indexOf(parseInt(thisData['WetId'])) >= 0 - property bool includedByFavorites: control.displayedCompCats.indexOf(-1) >= 0 && thisIsFavored - property bool includedByFilter: control.displayedCompCats.indexOf(parseInt(thisData['cat_id'])) >= 0 - property bool thisIsVisible: includedByFavorites || includedByFilter - - function updateVisibility() { - competitionDel.includedByFilter = control.displayedCompCats.indexOf(parseInt(competitionDel.thisData['cat_id'])) >= 0 - competitionDel.thisIsFavored = control.compFavorites.indexOf(parseInt(thisData['WetId'])) >= 0 - competitionDel.includedByFavorites = control.displayedCompCats.indexOf(-1) >= 0 && thisIsFavored - } - - width: parent.width - height: thisIsVisible ? compDelCol.height + 10 : 0 - - enabled: ((thisData["cats"] !== undefined && thisData["cats"].length > 0) || competitionDel.thisData["homepage"] !== undefined || getCompInfoUrls(index).length > 0) && height > 0 - //visible: includedByFilter - - opacity: 0 - scale: 0.9 - - Connections { - target: control - onDisplayedCompCatsChanged: { - competitionDel.updateVisibility() - } - - onCompFavoritesChanged: { - competitionDel.updateVisibility() - } - } - - onThisDataChanged: { - if(thisIsVisible){ - fadeInPa.start() - } - } - - onThisIsVisibleChanged: { - if(thisIsVisible){ - fadeInPa.start() - } - else { - fadeOutPa.start() - } - } - - Behavior on height { - NumberAnimation { - duration: 400 - } - } - - onClicked: { - control.openComp(index) - } - - ParallelAnimation { - id: fadeInPa - NumberAnimation { target: competitionDel; property: "opacity"; from: 0; to: 1.0; duration: 400 } - NumberAnimation { target: competitionDel; property: "scale"; from: 0.8; to: 1.0; duration: 400 } - } - - ParallelAnimation { - id: fadeOutPa - NumberAnimation { target: competitionDel; property: "opacity"; from: 1; to: 0; duration: 400 } - NumberAnimation { target: competitionDel; property: "scale"; from: 1; to: 0.8; duration: 400 } - } - - Rectangle { - id: delBackroundRect - - anchors.fill: parent - - opacity: 0.5 - - color: control.getCompCatData(catId) === undefined ? "white":control.getCompCatData(catId)["bgcolor"] - } - - Column { - id: compDelCol - - anchors.centerIn: parent - - width: parent.width * 0.97 - - spacing: 10 - - RowLayout { - width: parent.width - Label { - id: nameLa - - width: parent.width - - font.bold: true - - wrapMode: Text.WordWrap - - text: name - - Layout.fillWidth: true - } - - ToolButton { - id: bookmarkTb - icon.name: competitionDel.thisIsFavored ? "pinFilled":"pin" - onClicked: { - control.editFavorites(!competitionDel.thisIsFavored, parseInt(thisData['WetId'])) - } - - Layout.alignment: Layout.Right - - Behavior on icon.name { - SequentialAnimation { - NumberAnimation { - property: "scale" - target: bookmarkTb - duration: 75 - to: 0.8 - } - NumberAnimation { - property: "scale" - target: bookmarkTb - duration: 75 - to: 1 - } - } - } - } - } - - Label { - id: dateLa - - color: "grey" - - text: date - } - } - - Rectangle { - id: bottomLineRa - - anchors { - bottom: parent.bottom - left: parent.left - right: parent.right - } - - height: 1 - - color: "lightgrey" - - } + delegate: CompetitionCalendarDelegate { } section.property: "month" diff --git a/resources/qml/Widgets/ResultWidget.qml b/resources/qml/Widgets/ResultWidget.qml index 4139e81..d31b40b 100644 --- a/resources/qml/Widgets/ResultWidget.qml +++ b/resources/qml/Widgets/ResultWidget.qml @@ -17,7 +17,7 @@ */ import QtQuick 2.9 -import QtQuick.Controls 2.5 +import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import QtQuick.Controls.Material 2.3 @@ -37,12 +37,22 @@ DataListView { property bool titleIsPageTitle: true property Component headerComponent: RowLayout { - id: headerComponent height: parent.height - spacing: 0 + layoutDirection: Qt.RightToLeft + + ToolButton { + id: moreToolBt + + onClicked: { + control.changeCat() + } + + icon.name: "menu" + } + ToolButton { id: flowToolBt @@ -52,7 +62,7 @@ DataListView { onClicked: { if(speedFlowChartBackgroundRect.state === "hidden"){ - speedFlowChartBackgroundRect.state ="visible" + speedFlowChartBackgroundRect.state = "visible" control.positionViewAtBeginning() } else { @@ -62,18 +72,6 @@ DataListView { icon.name: "flowchart" } - - ToolButton { - id: moreToolBt - - Layout.alignment: Layout.Right - - onClicked: { - control.changeCat() - } - - icon.name: "menu" - } } property var widgetData: currentWidgetData @@ -163,7 +161,7 @@ DataListView { Connections { target: selector - onSelectionFinished: { + function onSelectionFinished(index, data) { if(data.cat !== undefined){ updateData({cat: data.cat}, true) } @@ -763,15 +761,15 @@ DataListView { Connections { target: speedFlowChartProduct - onPurchaseRestored: { + function onPurchaseRestored() { speedFlowChartLockedOverlay.state = appSettings.read("speedBackendPurchase") === "1" ? "unlocked":"locked" } - onPurchaseSucceeded: { + function onPurchaseSucceeded() { speedFlowChartLockedOverlay.state = appSettings.read("speedBackendPurchase") === "1" ? "unlocked":"locked" } - onPurchaseFailed: { + function onPurchaseFailed() { purchaseBt.text = qsTr("Purchase failed") purchaseBt.enabled = false buttonTextResetTimer.start() diff --git a/resources/qml/main.qml b/resources/qml/main.qml index fb2902a..82f29ca 100644 --- a/resources/qml/main.qml +++ b/resources/qml/main.qml @@ -45,96 +45,8 @@ Window { property var compCats: { - // --- ICC --- - - /*'int' : { - 'label' : 'International', - 'nation' : 'ICC', - 'wettk_reg' : '^[0-9]{2,2}[_^E]{1}[^YJ]{1,1}.*', - 'serie_reg' : '^[0-9]{2,2}_(WC|TR){1,1}.*', - 'rang_title': 'CUWR continuously updated WORLDRANKING', - 'bgcolor' : '#B8C8FF', - 'nat_team_ranking' : '', - 'cat_id' : [68,86]//[68,69,70,86,259] - },*/ - 'worldcup': { - 'label' : 'World Cups', - 'nation' : 'ICC', - 'bgcolor' : '#B8C8FF', - 'sort_rank': 1, - 'cat_id' : [69] - }, - 'youth' : { - 'label' : 'Youth Events', - 'nation' : 'ICC', - 'wettk_reg' : '^[0-9]{2,2}(EYC|_J|_Y){1,1}.*', - 'serie_reg' : '^[0-9]{2,2}_EYC', - 'rang_title': '', - 'bgcolor' : '#D8E8FF', - 'sort_rank': 2, - 'cat_id' : [71,258] - }, - 'cont': { - 'label' : 'Continental Events', - 'nation' : 'ICC', - 'bgcolor' : '#B8C8FF', - 'sort_rank': 3, - 'cat_id' : [262] - }, - 'masters' : { - 'label' : 'Masters and Promo Events', - 'nation' : 'ICC', - 'wettk_reg' : '^[0-9]{2,2}_[^PWERASL]{1}.*', - // 'serie_reg' : '^[0-9]{2,2}_(WC|TR){1,1}.*', - // 'rang_title': 'CUWR continuously updated WORLDRANKING', - 'bgcolor' : '#F0F0F0', - 'sort_rank': 4, - 'cat_id' : [70] - }, - 'para' : { - 'label' : 'Paraclimbing Events', - 'nation' : 'ICC', - 'wettk_reg' : '^[0-9]{2,2}_PE.*', - 'bgcolor' : '#F0F0F0', - 'sort_rank': 5, - 'cat_id' : [256,259] - }, - 'games': { - 'label': 'Games', - 'nation': 'ICC', - 'bgcolor' : '#B8C8FF', - 'sort_rank': 6, - 'cat_id': [68,86] - }, - // --- GER --- - /*'ger_boulder' : { - 'label' : 'Bouldern', - 'nation' : 'GER', - 'wettk_reg' : '^[0-9]{2,2}_B+.*', - 'serie_reg' : '^[0-9]{2,2}_BC', - 'bgcolor' : '#FFDBA8', //'#f59d30' - 'cat_id' : [59] - }, - 'ger' : { - 'label' : 'Lead', - 'nation' : 'GER', - 'wettk_reg' : '^[0-9]{2,2}[_J]{1,1}[^WLJ]+.*', - 'serie_reg' : '^[0-9]{2,2}_DC', - 'bgcolor' : '#A8F0A8', //'#69b9a9' - 'cat_id' : [57] - }, - 'ger_speed' : { - 'label' : 'Speed', - 'nation' : 'GER', - 'wettk_reg' : '^[0-9]{2,2}[_J]{1,1}[^WLJ]+.*', - 'serie_reg' : '', - 'rang_title': '', - 'bgcolor' : '#A8F0A8', //'#e72e5d' - 'cat_id' : [60] - },*/ - 'ger_meisterschaft' : { 'label' : 'Deutsche Meisterschaft', 'nation' : 'GER', @@ -148,7 +60,7 @@ Window { 'nation' : 'GER', 'wettk_reg' : '^[0-9]{2,2}[_J]{1,1}[^WL]+.*', 'serie_reg' : '^[0-9]{2,2}_JC', - // 'rang_title': 'Deutsche Jugend RANGLISTE', + // 'rang_title': 'Deutsche Jugend RANGLISTE', 'bgcolor' : '#D8FFD8', 'sort_rank': 2, 'cat_id' : [58] @@ -212,6 +124,7 @@ Window { //app.openAthlete(53139) // dorian: 53139 , rustam: 6933 , helen: 53300 //openWidget({nation:'GER'}) //mainStack.push("Pages/AthleteSearchPage.qml") + //openWidget({comp: 11651, cat: 25}) } Shortcut { @@ -235,8 +148,6 @@ Window { StackView { id: mainStack - //enabled: !loadingDl.opened - anchors { top: toolBar.bottom left: parent.left @@ -411,28 +322,18 @@ Window { height: parent.height - Layout.alignment: Layout.Right + onItemChanged: { + if(item === null) + return - onStatusChanged: { - //console.log("loader status changed: " + status) - - if(status == 0){ - extraComponentLoader.Layout.preferredWidth = 0 - } - else { - extraComponentLoader.item.width = extraComponentLoader.item.implicitWidth - extraComponentLoader.Layout.preferredWidth = extraComponentLoader.item.width - widthChangedCon.target = extraComponentLoader.item - } - - //console.log("set loader width to: " + extraComponentLoader.Layout.preferredWidth + " for a item width of: " + extraComponentLoader.item.implicitWidth) + extraComponentLoader.item.width = extraComponentLoader.item.implicitWidth + extraComponentLoader.Layout.preferredWidth = extraComponentLoader.item.width + widthChangedCon.target = extraComponentLoader.item } - //sourceComponent: mainStack.currentItem.headerComponent - Connections { target: mainStack - onCurrentItemChanged: { + function onCurrentItemChanged() { secondCon.target = mainStack.currentItem disappearNa.start() } @@ -440,14 +341,15 @@ Window { Connections { id: secondCon - onHeaderComponentChanged: { + target: null + function onHeaderComponentChanged() { disappearNa.start() } } Connections { id: widthChangedCon - onImplicitWidthChanged:{ + function onImplicitWidthChanged() { extraComponentLoader.item.width = extraComponentLoader.item.implicitWidth extraComponentLoader.Layout.preferredWidth = extraComponentLoader.item.implicitWidth } diff --git a/resources/qml/qml.qrc b/resources/qml/qml.qrc index 7084d45..e19b2bf 100644 --- a/resources/qml/qml.qrc +++ b/resources/qml/qml.qrc @@ -19,5 +19,6 @@ Pages/AthleteSearchPage.qml Components/SpeedFlowChart.qml Components/SwipeGallery.qml + Components/CompetitionCalendarDelegate.qml diff --git a/resources/shared/blueRockHold.xcf b/resources/shared/blueRockHold.xcf new file mode 100644 index 0000000..be3ca69 Binary files /dev/null and b/resources/shared/blueRockHold.xcf differ diff --git a/resources/shared/icons/blueRockHold.png b/resources/shared/icons/blueRockHold.png new file mode 100644 index 0000000..3578b4b Binary files /dev/null and b/resources/shared/icons/blueRockHold.png differ diff --git a/resources/shared/icons/dav.png b/resources/shared/icons/dav.png index 055d1d2..19da0bf 100644 Binary files a/resources/shared/icons/dav.png and b/resources/shared/icons/dav.png differ diff --git a/resources/shared/icons/favicon.png b/resources/shared/icons/favicon.png deleted file mode 100644 index fa868e0..0000000 Binary files a/resources/shared/icons/favicon.png and /dev/null differ diff --git a/resources/shared/shared.qrc b/resources/shared/shared.qrc index 53b5424..e0c3508 100644 --- a/resources/shared/shared.qrc +++ b/resources/shared/shared.qrc @@ -28,7 +28,6 @@ icons/bluerock/index.theme icons/dig_rock.klein.jpg icons/dig_rock.klein.png - icons/favicon.png icons/bluerock/20x20/calendar.png icons/bluerock/20x20@2/calendar.png icons/bluerock/20x20@3/calendar.png @@ -77,5 +76,6 @@ screenshots/SpeedFlowchartDemo/1.png screenshots/SpeedFlowchartDemo/2.png screenshots/SpeedFlowchartDemo/3.png + icons/blueRockHold.png diff --git a/sources/serverconn.cpp b/sources/serverconn.cpp index 6747562..2279dec 100644 --- a/sources/serverconn.cpp +++ b/sources/serverconn.cpp @@ -22,10 +22,10 @@ ServerConn::ServerConn(QObject *parent) : QObject(parent) { } -QVariant ServerConn::getWidgetData(QVariantMap params){ +QVariant ServerConn::getWidgetData(QVariantMap params) { QString requestUrl; - if(params["nation"].toString() == "ICC"){ - requestUrl = "https://ifsc-egw.wavecdn.net/egw/ranking/json.php?"; + if(params["nation"].toString() == "ICC") { + requestUrl = "https://www.digitalrock.de/egroupware/ranking/json.php?"; params["nation"] = ""; } else if (params["nation"].toString() == "GER") { @@ -39,7 +39,7 @@ QVariant ServerConn::getWidgetData(QVariantMap params){ requestUrl = "https://www.digitalrock.de/egroupware/ranking/json.php?"; } - for(QVariantMap::const_iterator iter = params.begin(); iter != params.end(); ++iter){ + for(QVariantMap::const_iterator iter = params.begin(); iter != params.end(); ++iter) { requestUrl += iter.key() + "=" + iter.value().toString() + "&"; } @@ -49,7 +49,7 @@ QVariant ServerConn::getWidgetData(QVariantMap params){ QVariantMap ret = this->senddata(QUrl(requestUrl)); - if(ret["status"] != 200){ + if(ret["status"] != 200) { // request was a failure return QVariantMap({{"status", ret["status"]}, {"data", ""}}); } @@ -85,7 +85,7 @@ QVariantMap ServerConn::senddata(QUrl serviceUrl, QUrlQuery pdata) QNetworkReply *reply; - if(pdata.isEmpty()){ + if(pdata.isEmpty()) { // if no post data is given -> send a GET request reply = networkManager->get(request); }