From 39d66c2150f72c0910458d38eba8e020d6e9a00e Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Tue, 26 May 2020 17:57:54 +0200 Subject: [PATCH] - adapted to new ScStw import paths - fixed cancel not working --- ScStwSrc/headers/scstwappbackend.h | 1 - .../qml/ProfilesDialog/AddProfilePage.qml | 6 +- .../qml/ProfilesDialog/ProfileListPage.qml | 6 +- .../qml/ProfilesDialog/ProfilesDialog.qml | 7 +- .../qml/ProfilesDialog/ProfilesStack.qml | 6 +- .../qml/ProfilesDialog/ResultListPage.qml | 7 +- .../SettingsBaseStationPage.qml | 6 +- .../SettingsStartSequencePage.qml | 7 +- .../qml/SettingsDialog/StartPage.qml | 6 +- .../qml/components/FadeAnimation.qml | 70 ------------------- .../qml/components/FancyBusyIndicator.qml | 65 ----------------- .../qml/components/RemoteDataListView.qml | 8 ++- ScStwSrc/resources/qml/main.qml | 7 +- ScStwSrc/resources/qml/qml.qrc | 2 - ScStwSrc/sources/main.cpp | 23 +++--- shared-libraries | 2 +- 16 files changed, 64 insertions(+), 165 deletions(-) delete mode 100644 ScStwSrc/resources/qml/components/FadeAnimation.qml delete mode 100644 ScStwSrc/resources/qml/components/FancyBusyIndicator.qml diff --git a/ScStwSrc/headers/scstwappbackend.h b/ScStwSrc/headers/scstwappbackend.h index 14a67bd..9a5a5cf 100644 --- a/ScStwSrc/headers/scstwappbackend.h +++ b/ScStwSrc/headers/scstwappbackend.h @@ -31,7 +31,6 @@ private: ScStwClient * scStwClient; QTimer * timerTextRefreshTimer; - // TODO: DOINEED? QTimer * nextStartActionTimer; ScStwRace * localRace; ScStwRemoteMonitorRace * remoteRace; diff --git a/ScStwSrc/resources/qml/ProfilesDialog/AddProfilePage.qml b/ScStwSrc/resources/qml/ProfilesDialog/AddProfilePage.qml index 583961c..72de7d4 100644 --- a/ScStwSrc/resources/qml/ProfilesDialog/AddProfilePage.qml +++ b/ScStwSrc/resources/qml/ProfilesDialog/AddProfilePage.qml @@ -21,7 +21,11 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 -import com.itsblue.speedclimbingstopwatch 2.0 + +import de.itsblue.ScStw 2.0 +import de.itsblue.ScStw.Styling 2.0 +import de.itsblue.ScStw.Styling.Components 1.0 +import de.itsblue.ScStwApp 2.0 import "../components" diff --git a/ScStwSrc/resources/qml/ProfilesDialog/ProfileListPage.qml b/ScStwSrc/resources/qml/ProfilesDialog/ProfileListPage.qml index 5a37b42..d6686dd 100644 --- a/ScStwSrc/resources/qml/ProfilesDialog/ProfileListPage.qml +++ b/ScStwSrc/resources/qml/ProfilesDialog/ProfileListPage.qml @@ -21,7 +21,11 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 -import com.itsblue.speedclimbingstopwatch 2.0 + +import de.itsblue.ScStw 2.0 +import de.itsblue.ScStw.Styling 2.0 +import de.itsblue.ScStw.Styling.Components 1.0 +import de.itsblue.ScStwApp 2.0 import "../components" diff --git a/ScStwSrc/resources/qml/ProfilesDialog/ProfilesDialog.qml b/ScStwSrc/resources/qml/ProfilesDialog/ProfilesDialog.qml index b2747a3..645a405 100644 --- a/ScStwSrc/resources/qml/ProfilesDialog/ProfilesDialog.qml +++ b/ScStwSrc/resources/qml/ProfilesDialog/ProfilesDialog.qml @@ -21,7 +21,12 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 -import com.itsblue.speedclimbingstopwatch 2.0 + +import de.itsblue.ScStw 2.0 +import de.itsblue.ScStw.Styling 2.0 +import de.itsblue.ScStw.Styling.Components 1.0 +import de.itsblue.ScStwApp 2.0 + import "../components" diff --git a/ScStwSrc/resources/qml/ProfilesDialog/ProfilesStack.qml b/ScStwSrc/resources/qml/ProfilesDialog/ProfilesStack.qml index 012be83..c424384 100644 --- a/ScStwSrc/resources/qml/ProfilesDialog/ProfilesStack.qml +++ b/ScStwSrc/resources/qml/ProfilesDialog/ProfilesStack.qml @@ -21,7 +21,11 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 -import com.itsblue.speedclimbingstopwatch 2.0 + +import de.itsblue.ScStw 2.0 +import de.itsblue.ScStw.Styling 2.0 +import de.itsblue.ScStw.Styling.Components 1.0 +import de.itsblue.ScStwApp 2.0 import "../components" diff --git a/ScStwSrc/resources/qml/ProfilesDialog/ResultListPage.qml b/ScStwSrc/resources/qml/ProfilesDialog/ResultListPage.qml index 4836e98..4a337c9 100644 --- a/ScStwSrc/resources/qml/ProfilesDialog/ResultListPage.qml +++ b/ScStwSrc/resources/qml/ProfilesDialog/ResultListPage.qml @@ -21,7 +21,12 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 -import com.itsblue.speedclimbingstopwatch 2.0 + +import de.itsblue.ScStw 2.0 +import de.itsblue.ScStw.Styling 2.0 +import de.itsblue.ScStw.Styling.Components 1.0 +import de.itsblue.ScStwApp 2.0 + import "../components" RemoteDataListView { diff --git a/ScStwSrc/resources/qml/SettingsDialog/SettingsBaseStationPage.qml b/ScStwSrc/resources/qml/SettingsDialog/SettingsBaseStationPage.qml index 4f48736..94f2a9f 100644 --- a/ScStwSrc/resources/qml/SettingsDialog/SettingsBaseStationPage.qml +++ b/ScStwSrc/resources/qml/SettingsDialog/SettingsBaseStationPage.qml @@ -7,7 +7,11 @@ import QtGraphicalEffects 1.0 import QtQuick.Controls.Styles 1.4 import QtQuick.Templates 2.12 as T -import com.itsblue.speedclimbingstopwatch 2.0 + +import de.itsblue.ScStw 2.0 +import de.itsblue.ScStw.Styling 2.0 +import de.itsblue.ScStw.Styling.Components 1.0 +import de.itsblue.ScStwApp 2.0 import "../components" diff --git a/ScStwSrc/resources/qml/SettingsDialog/SettingsStartSequencePage.qml b/ScStwSrc/resources/qml/SettingsDialog/SettingsStartSequencePage.qml index 30a6712..9950f11 100644 --- a/ScStwSrc/resources/qml/SettingsDialog/SettingsStartSequencePage.qml +++ b/ScStwSrc/resources/qml/SettingsDialog/SettingsStartSequencePage.qml @@ -5,7 +5,12 @@ import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import QtQuick.Controls.Styles 1.4 -import com.itsblue.speedclimbingstopwatch 2.0 + +import de.itsblue.ScStw 2.0 +import de.itsblue.ScStw.Styling 2.0 +import de.itsblue.ScStw.Styling.Components 1.0 +import de.itsblue.ScStwApp 2.0 + import "../components" Column { diff --git a/ScStwSrc/resources/qml/SettingsDialog/StartPage.qml b/ScStwSrc/resources/qml/SettingsDialog/StartPage.qml index 91b99ed..94b592e 100644 --- a/ScStwSrc/resources/qml/SettingsDialog/StartPage.qml +++ b/ScStwSrc/resources/qml/SettingsDialog/StartPage.qml @@ -6,7 +6,11 @@ import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import QtQuick.Controls.Styles 1.4 -import com.itsblue.speedclimbingstopwatch 2.0 +import de.itsblue.ScStw 2.0 +import de.itsblue.ScStw.Styling 2.0 +import de.itsblue.ScStw.Styling.Components 1.0 +import de.itsblue.ScStwApp 2.0 + import "../components" Column { diff --git a/ScStwSrc/resources/qml/components/FadeAnimation.qml b/ScStwSrc/resources/qml/components/FadeAnimation.qml deleted file mode 100644 index 40343b7..0000000 --- a/ScStwSrc/resources/qml/components/FadeAnimation.qml +++ /dev/null @@ -1,70 +0,0 @@ -/* - Speed Climbing Stopwatch - Simple Stopwatch for Climbers - Copyright (C) 2018 Itsblue Development - Dorian Zeder - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, version 3 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . -*/ - -import QtQuick 2.0 - -SequentialAnimation { - id: root - property QtObject target - property string fadeProperty: "scale" - property int fadeDuration: 150 - property int fadeDuration_in: fadeDuration - property int fadeDuration_out: fadeDuration - property alias outValue: outAnimation.to - property alias inValue: inAnimation.to - property alias outEasingType: outAnimation.easing.type - property alias inEasingType: inAnimation.easing.type - property string easingType: "Quad" - ParallelAnimation { - NumberAnimation { // in the default case, fade scale to 0 - id: outAnimation - target: root.target - property: "scale" - duration: root.fadeDuration_in - to: 0.9 - easing.type: Easing["In"+root.easingType] - } - NumberAnimation { // in the default case, fade scale to 0 - id: outAnimation2 - target: root.target - property: "opacity" - duration: root.fadeDuration_in - to: 0 - easing.type: Easing["In"+root.easingType] - } - } - PropertyAction { } // actually change the property targeted by the Behavior between the 2 other animations - ParallelAnimation { - NumberAnimation { // in the default case, fade scale back to 1 - id: inAnimation - target: root.target - property: root.fadeProperty - duration: root.fadeDuration_out - to: 1 - easing.type: Easing["Out"+root.easingType] - } - NumberAnimation { // in the default case, fade scale to 0 - id: inAnimation2 - target: root.target - property: "opacity" - duration: root.fadeDuration_in - to: 1 - easing.type: Easing["In"+root.easingType] - } - } - -} diff --git a/ScStwSrc/resources/qml/components/FancyBusyIndicator.qml b/ScStwSrc/resources/qml/components/FancyBusyIndicator.qml deleted file mode 100644 index ba6631f..0000000 --- a/ScStwSrc/resources/qml/components/FancyBusyIndicator.qml +++ /dev/null @@ -1,65 +0,0 @@ -import QtQuick 2.3 -import QtQuick.Controls 2.4 -import QtQuick.Controls.Styles 1.2 - -BusyIndicator { - id: control - - property double animationSpeed: 1000 - property double formFactor: 4.5 - - property color lineColor: "#21be2b" - - contentItem: Item { - implicitWidth: 64 - implicitHeight: 64 - - Item { - id: item - - anchors.fill: parent - - property int currentHeight: 0 - - SequentialAnimation { - running: control.running - loops: Animation.Infinite - - NumberAnimation { - target: item - property: "currentHeight" - from: 0 - to: 800 - duration: control.animationSpeed - } - } - - Row { - - anchors.fill: parent - - spacing: item.width / 9 - - Repeater { - id: repeater - model: 5 - - Rectangle { - - property double heightMultiplier: Math.abs( Math.sin( ( ((item.currentHeight/100) + (index*(control.formFactor/repeater.model)))) * (Math.PI/8) ) ) - - anchors.verticalCenter: parent.verticalCenter - - width: item.width / 9 - height: ( heightMultiplier ) * ( item.height - 1 ) + 1 - - radius: width * 0.5 - - color: control.lineColor - - } - } - } - } - } -} diff --git a/ScStwSrc/resources/qml/components/RemoteDataListView.qml b/ScStwSrc/resources/qml/components/RemoteDataListView.qml index 4e825b1..6fb0a46 100644 --- a/ScStwSrc/resources/qml/components/RemoteDataListView.qml +++ b/ScStwSrc/resources/qml/components/RemoteDataListView.qml @@ -1,6 +1,8 @@ import QtQuick 2.10 import QtQuick.Controls 2.4 +import de.itsblue.ScStw.Styling.Components 1.0 + Item { id: control @@ -73,8 +75,12 @@ Item { } - FancyBusyIndicator { + BusyIndicator { anchors.centerIn: parent + + width: app.landscape() ? parent.height * 0.1:parent.width * 0.1 + height: width + opacity: !(status === 200 || status === 902) ? 1:0 Behavior on opacity { diff --git a/ScStwSrc/resources/qml/main.qml b/ScStwSrc/resources/qml/main.qml index bb6781c..bca19c5 100644 --- a/ScStwSrc/resources/qml/main.qml +++ b/ScStwSrc/resources/qml/main.qml @@ -26,7 +26,10 @@ import "./ProfilesDialog" import "./SettingsDialog" //import QtQuick.Layouts 1.11 -import com.itsblue.speedclimbingstopwatch 2.0 +import de.itsblue.ScStw 2.0 +import de.itsblue.ScStw.Styling 2.0 +import de.itsblue.ScStw.Styling.Components 1.0 +import de.itsblue.ScStwApp 2.0 Window { visible: true @@ -873,7 +876,7 @@ Window { } function cancel() { - var ret = speedBackend.race.cancelStart(false) + var ret = speedBackend.race.cancel() if(ret !== 200){ console.log("+ --- error canellingr race: " + ret) } diff --git a/ScStwSrc/resources/qml/qml.qrc b/ScStwSrc/resources/qml/qml.qrc index 68a8a3b..526b689 100644 --- a/ScStwSrc/resources/qml/qml.qrc +++ b/ScStwSrc/resources/qml/qml.qrc @@ -3,7 +3,6 @@ main.qml components/ProgressCircle.qml components/ConnectionDelegate.qml - components/FadeAnimation.qml components/ConnectionIcon.qml components/NextPageDelegate.qml components/FancyButton.qml @@ -12,7 +11,6 @@ components/InputDelegate.qml components/SmoothSliderDelegate.qml components/RemoteDataListView.qml - components/FancyBusyIndicator.qml ProfilesDialog/ProfilesDialog.qml ProfilesDialog/ProfilesStack.qml ProfilesDialog/ProfileListPage.qml diff --git a/ScStwSrc/sources/main.cpp b/ScStwSrc/sources/main.cpp index 948e7a9..602b423 100644 --- a/ScStwSrc/sources/main.cpp +++ b/ScStwSrc/sources/main.cpp @@ -54,12 +54,8 @@ //#include "headers/speedtimer.h" //#include "headers/climbingrace.h" #include "headers/scstwappbackend.h" -#include -#include -#include -#include -#include -#include +#include +#include #include int main(int argc, char *argv[]) @@ -88,21 +84,18 @@ int main(int argc, char *argv[]) AppSettings * pAppSettings = new AppSettings(); - // setup speed backend and App themes - qmlRegisterType("com.itsblue.speedclimbingstopwatch", 2, 0, "SpeedBackend"); - qmlRegisterType("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStwRace"); - qmlRegisterType("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStwTimer"); - qmlRegisterUncreatableType("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStwAppTheme", "The ScStwAppTheme has to be managed by a ScStwAppTheme manager and is therefore not creatable"); - qmlRegisterType("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStwAppThemeManager"); - qmlRegisterType("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStw"); - qmlRegisterType("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStwClient"); + // setup speed backend + qmlRegisterType("de.itsblue.ScStwApp", 2, 0, "SpeedBackend"); QQmlApplicationEngine engine; + ScStwLibraries::init(); + ScStwStyling::init(&engine); + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); QQmlContext *context = engine.rootContext(); - // stup app settings + // setup app settings context->setContextProperty("_cppAppSettings", pAppSettings); if (engine.rootObjects().isEmpty()) diff --git a/shared-libraries b/shared-libraries index c027fa2..81ee198 160000 --- a/shared-libraries +++ b/shared-libraries @@ -1 +1 @@ -Subproject commit c027fa242afc77746af5028af2919ffd3905658b +Subproject commit 81ee19819c8698054279557090c94280c43ea41d