2018-08-12 20:51:57 +02:00
|
|
|
/*
|
|
|
|
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 <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2018-07-25 00:32:20 +02:00
|
|
|
import QtQuick 2.9
|
|
|
|
import QtMultimedia 5.8
|
|
|
|
import QtQuick.Window 2.2
|
|
|
|
import QtQuick.Controls 2.2
|
2018-07-28 14:12:55 +02:00
|
|
|
import QtQuick.Layouts 1.3
|
2019-03-08 15:36:32 +01:00
|
|
|
import QtGraphicalEffects 1.0
|
2019-03-29 19:15:20 +01:00
|
|
|
import QtQuick.Controls.Styles 1.4
|
2018-08-28 23:03:35 +02:00
|
|
|
import "./components"
|
2018-07-25 00:32:20 +02:00
|
|
|
|
2018-07-26 20:51:46 +02:00
|
|
|
Popup {
|
|
|
|
id: root
|
2018-07-26 22:13:43 +02:00
|
|
|
modal: true
|
|
|
|
dim: false
|
2019-03-08 15:36:32 +01:00
|
|
|
opacity: 0
|
2018-07-25 00:32:20 +02:00
|
|
|
|
|
|
|
enter: Transition {
|
2019-03-08 15:36:32 +01:00
|
|
|
NumberAnimation { properties: "opacity"; to: 1; duration: 300; easing.type: Easing.InOutQuad }
|
2019-04-30 23:44:04 +02:00
|
|
|
NumberAnimation { properties: "scale"; from: 0.9; to: 1; duration: 300; easing.type: Easing.InOutQuad }
|
2018-07-25 00:32:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
exit: Transition {
|
2019-03-08 15:36:32 +01:00
|
|
|
NumberAnimation { properties: "opacity"; to: 0; duration: 300; easing.type: Easing.InOutQuad }
|
2019-04-30 23:44:04 +02:00
|
|
|
NumberAnimation { properties: "scale"; from: 1; to: 0.9; duration: 300; easing.type: Easing.InOutQuad }
|
2018-07-26 20:51:46 +02:00
|
|
|
}
|
2018-07-25 00:32:20 +02:00
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
radius: width * 0.5
|
2019-03-08 18:03:27 +01:00
|
|
|
color: appTheme.style.viewColor
|
|
|
|
border.color: appTheme.style.lineColor
|
2019-03-08 15:36:32 +01:00
|
|
|
border.width: 0
|
|
|
|
|
2019-03-24 21:31:59 +01:00
|
|
|
Behavior on color {
|
|
|
|
ColorAnimation {
|
|
|
|
duration: 200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 15:36:32 +01:00
|
|
|
RectangularGlow {
|
2019-03-29 19:15:20 +01:00
|
|
|
id: headerUnderlineEffect
|
2019-03-08 15:36:32 +01:00
|
|
|
glowRadius: 7
|
|
|
|
spread: 0.02
|
|
|
|
color: "black"
|
|
|
|
opacity: 0.18
|
|
|
|
anchors.fill: headlineUnderline
|
|
|
|
scale: 1
|
|
|
|
}
|
|
|
|
|
|
|
|
Canvas {
|
|
|
|
|
|
|
|
id: headerBackground
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
top: parent.top
|
|
|
|
bottom: headlineUnderline.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
height: header.height
|
|
|
|
width: header.width
|
|
|
|
|
2019-03-08 18:03:27 +01:00
|
|
|
property color color: appTheme.style.viewColor
|
2019-03-08 15:36:32 +01:00
|
|
|
|
2019-03-24 21:31:59 +01:00
|
|
|
Behavior on color {
|
|
|
|
ColorAnimation {
|
|
|
|
duration: 200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 15:36:32 +01:00
|
|
|
onColorChanged: {
|
|
|
|
requestPaint()
|
|
|
|
}
|
|
|
|
|
|
|
|
onPaint: {
|
|
|
|
var ctx = getContext("2d");
|
|
|
|
ctx.reset();
|
|
|
|
|
|
|
|
var centreX = root.width / 2;
|
|
|
|
var centreY = root.height / 2;
|
|
|
|
|
|
|
|
ctx.beginPath();
|
|
|
|
ctx.fillStyle = headerBackground.color
|
|
|
|
ctx.moveTo(centreX, centreY);
|
|
|
|
ctx.arc(centreX, centreY, root.width / 2, 1 * Math.PI, 2*Math.PI, false);
|
|
|
|
//ctx.lineTo(centreX, centreY);
|
|
|
|
ctx.fill();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: header
|
2018-07-28 14:12:55 +02:00
|
|
|
|
2018-07-25 00:32:20 +02:00
|
|
|
anchors {
|
2019-03-08 15:36:32 +01:00
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
2018-07-25 00:32:20 +02:00
|
|
|
top: parent.top
|
2019-03-08 15:36:32 +01:00
|
|
|
bottom: headlineUnderline.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: head_text
|
2019-03-29 19:15:20 +01:00
|
|
|
|
2019-03-08 15:36:32 +01:00
|
|
|
anchors {
|
2019-03-29 19:15:20 +01:00
|
|
|
centerIn: parent
|
2019-03-08 15:36:32 +01:00
|
|
|
}
|
2019-03-29 19:15:20 +01:00
|
|
|
|
|
|
|
width: headlineUnderline.width * 0.4
|
|
|
|
height: parent.height
|
|
|
|
|
|
|
|
fontSizeMode: Text.Fit
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
|
|
|
text: options_stack.currentItem.title
|
|
|
|
font.pixelSize: headlineUnderline.width * 0.1
|
|
|
|
color: enabled ? appTheme.style.textColor:appTheme.style.disabledTextColor
|
2018-07-25 00:32:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: headlineUnderline
|
|
|
|
height: 1
|
|
|
|
width: parent.width
|
2019-03-08 18:03:27 +01:00
|
|
|
color: appTheme.style.lineColor
|
2019-03-08 15:36:32 +01:00
|
|
|
visible: false
|
2018-07-25 00:32:20 +02:00
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
topMargin: parent.height * 0.15
|
|
|
|
rightMargin: parent.radius - Math.sqrt(Math.pow(parent.radius,2)-Math.pow(parent.radius-anchors.topMargin,2))
|
|
|
|
leftMargin: parent.radius - Math.sqrt(Math.pow(parent.radius,2)-Math.pow(parent.radius-anchors.topMargin,2))
|
|
|
|
}
|
|
|
|
}
|
2018-07-28 14:12:55 +02:00
|
|
|
|
2019-03-08 15:36:32 +01:00
|
|
|
FancyButton {
|
2018-07-28 14:12:55 +02:00
|
|
|
id: head_back
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: parent.width * 0.17
|
|
|
|
top:parent.top
|
2018-08-03 15:18:23 +02:00
|
|
|
topMargin: parent.height * 0.01
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
2018-08-28 23:03:35 +02:00
|
|
|
|
2018-08-03 15:18:23 +02:00
|
|
|
height: parent.height * 0.13
|
2018-08-28 23:03:35 +02:00
|
|
|
width: height
|
2019-03-08 15:36:32 +01:00
|
|
|
//opacity: root.closePolicy === Popup.NoAutoClose ? 0:1
|
2018-08-18 21:27:18 +02:00
|
|
|
enabled: opacity > 0
|
2018-07-28 14:12:55 +02:00
|
|
|
|
2019-03-08 15:36:32 +01:00
|
|
|
glowOpacity: Math.pow( root.opacity, 100 )
|
2018-07-28 14:12:55 +02:00
|
|
|
|
2019-03-08 18:03:27 +01:00
|
|
|
image: appTheme.style.backIcon
|
2018-07-28 14:12:55 +02:00
|
|
|
|
|
|
|
onClicked: {
|
2019-03-07 17:18:24 +01:00
|
|
|
options_stack.depth > 1 ? options_stack.pop():root.close()
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Behavior on opacity {
|
|
|
|
NumberAnimation {
|
2018-08-28 23:03:35 +02:00
|
|
|
duration: 200
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-07-25 00:32:20 +02:00
|
|
|
}
|
2018-07-26 20:51:46 +02:00
|
|
|
|
2018-07-28 14:12:55 +02:00
|
|
|
StackView {
|
|
|
|
id: options_stack
|
2019-03-29 19:15:20 +01:00
|
|
|
property int delegateHeight: height * 0.2
|
|
|
|
property int rowSpacing: height * 0.01
|
2018-07-28 14:12:55 +02:00
|
|
|
initialItem: settings
|
|
|
|
width: headlineUnderline.width
|
2018-07-25 00:32:20 +02:00
|
|
|
|
2018-08-18 21:27:18 +02:00
|
|
|
enabled: opacity !== 0 //disable when not visible
|
|
|
|
|
2018-07-28 14:12:55 +02:00
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: ( parent.width - headlineUnderline.width ) / 2
|
2019-03-27 22:24:59 +01:00
|
|
|
topMargin: headlineUnderline.anchors.topMargin * 0.95
|
2018-07-28 14:12:55 +02:00
|
|
|
bottom: parent.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
Behavior on opacity {
|
|
|
|
NumberAnimation {duration: 200}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-----start page of the settings-----*/
|
|
|
|
Component {
|
|
|
|
id: settings
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: settings_col
|
2019-03-29 19:15:20 +01:00
|
|
|
|
|
|
|
property string title: qsTr("Options")
|
2019-01-01 15:23:15 +01:00
|
|
|
spacing: options_stack.rowSpacing
|
2018-07-28 14:12:55 +02:00
|
|
|
|
2018-08-28 23:03:35 +02:00
|
|
|
/*----Connect to external devices----*/
|
2018-10-04 18:35:29 +02:00
|
|
|
NextPageDelegate {
|
2018-07-28 14:12:55 +02:00
|
|
|
id: connect_del
|
2019-03-29 19:15:20 +01:00
|
|
|
|
|
|
|
height: options_stack.delegateHeight
|
|
|
|
|
2019-03-07 17:18:24 +01:00
|
|
|
text: qsTr("Base Station")
|
2018-08-18 21:27:18 +02:00
|
|
|
onClicked: {
|
|
|
|
options_stack.push(connect)
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*----Automated Start----*/
|
2018-10-04 18:35:29 +02:00
|
|
|
NextPageDelegate {
|
2018-07-28 14:12:55 +02:00
|
|
|
id: autostart_del
|
2019-03-29 19:15:20 +01:00
|
|
|
|
|
|
|
height: options_stack.delegateHeight
|
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
text: qsTr("Start sequence")
|
2018-07-28 14:12:55 +02:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
options_stack.push(autostart)
|
|
|
|
}
|
2018-07-26 20:51:46 +02:00
|
|
|
}
|
2018-08-28 23:03:35 +02:00
|
|
|
|
|
|
|
/*----Style Settings----*/
|
2019-03-27 22:24:59 +01:00
|
|
|
SmoothSwitchDelegate {
|
|
|
|
id: styleDel
|
2019-09-22 16:07:41 +02:00
|
|
|
text: qsTr("Dark mode")
|
2018-08-28 23:03:35 +02:00
|
|
|
|
2019-03-29 19:15:20 +01:00
|
|
|
width: parent.width
|
|
|
|
height: options_stack.delegateHeight
|
|
|
|
|
2019-03-27 22:24:59 +01:00
|
|
|
checked: speedBackend.readSetting("theme") === "Dark"
|
2018-08-28 23:03:35 +02:00
|
|
|
|
2019-03-27 22:24:59 +01:00
|
|
|
onCheckedChanged: {
|
|
|
|
speedBackend.writeSetting("theme", checked ? "Dark":"Light")
|
|
|
|
appTheme.refreshTheme()
|
2019-01-01 15:23:15 +01:00
|
|
|
}
|
|
|
|
}
|
2018-07-26 20:51:46 +02:00
|
|
|
}
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
2018-07-26 20:51:46 +02:00
|
|
|
|
2018-07-28 14:12:55 +02:00
|
|
|
/*-----Page to setup automatc start sequence-----*/
|
|
|
|
Component {
|
|
|
|
id: autostart
|
|
|
|
Column {
|
|
|
|
id: autostart_col
|
2019-03-29 19:15:20 +01:00
|
|
|
|
|
|
|
spacing: options_stack.rowSpacing
|
|
|
|
|
2018-07-28 14:12:55 +02:00
|
|
|
property string title: "Autostart"
|
|
|
|
|
2019-03-03 17:31:24 +01:00
|
|
|
function updateSetting(key, val, del){
|
2019-03-07 17:18:24 +01:00
|
|
|
speedBackend.writeSetting(key, val)
|
2018-10-04 18:35:29 +02:00
|
|
|
}
|
|
|
|
|
2019-03-02 23:01:05 +01:00
|
|
|
function loadSetting(key, del){
|
2019-08-19 15:14:11 +02:00
|
|
|
return speedBackend.readSetting(key)
|
2019-03-02 23:01:05 +01:00
|
|
|
}
|
|
|
|
|
2019-03-27 22:24:59 +01:00
|
|
|
SmoothSwitchDelegate {
|
2018-07-28 14:12:55 +02:00
|
|
|
id: ready_del
|
2018-08-28 23:03:35 +02:00
|
|
|
|
2018-07-28 14:12:55 +02:00
|
|
|
width: parent.width
|
2019-03-29 19:15:20 +01:00
|
|
|
height: options_stack.delegateHeight
|
2018-08-11 23:54:34 +02:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
text: qsTr("Say 'ready'")
|
2019-03-29 19:15:20 +01:00
|
|
|
|
|
|
|
checked: parent.loadSetting("ready_en", ready_del) === "true"
|
2018-07-28 14:12:55 +02:00
|
|
|
|
|
|
|
onCheckedChanged: {
|
2019-03-03 17:31:24 +01:00
|
|
|
parent.updateSetting("ready_en",checked, ready_del)
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
2018-07-26 20:51:46 +02:00
|
|
|
}
|
2018-07-28 14:12:55 +02:00
|
|
|
|
2019-03-29 19:15:20 +01:00
|
|
|
InputDelegate {
|
2018-07-28 14:12:55 +02:00
|
|
|
id: ready_delay_del
|
2018-08-28 23:03:35 +02:00
|
|
|
|
2018-07-28 14:12:55 +02:00
|
|
|
width: parent.width
|
2019-03-29 19:15:20 +01:00
|
|
|
height: options_stack.delegateHeight
|
|
|
|
|
|
|
|
enabled: ready_del.checked
|
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
text: qsTr("Delay (ms)")
|
2019-03-29 23:42:56 +01:00
|
|
|
inputHint: qsTr("time")
|
|
|
|
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
2019-03-29 19:15:20 +01:00
|
|
|
|
|
|
|
inputText: autostart_col.loadSetting("ready_delay", ready_del)
|
|
|
|
|
2019-04-08 18:03:23 +02:00
|
|
|
onInputFinished: {
|
2019-03-29 19:15:20 +01:00
|
|
|
autostart_col.updateSetting("ready_delay", inputText, ready_delay_del)
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
2018-07-26 20:51:46 +02:00
|
|
|
}
|
|
|
|
|
2019-03-27 22:24:59 +01:00
|
|
|
SmoothSwitchDelegate {
|
2018-07-28 14:12:55 +02:00
|
|
|
id: at_marks_del
|
2018-08-28 23:03:35 +02:00
|
|
|
|
2018-07-28 14:12:55 +02:00
|
|
|
width: parent.width
|
2019-03-29 19:15:20 +01:00
|
|
|
height: options_stack.delegateHeight
|
2018-08-11 23:54:34 +02:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
text: qsTr("Say 'at your marks'")
|
2019-03-29 19:15:20 +01:00
|
|
|
|
|
|
|
checked: autostart_col.loadSetting("at_marks_en", ready_del) === "true"
|
2018-07-28 14:12:55 +02:00
|
|
|
|
|
|
|
onCheckedChanged: {
|
2019-03-03 17:31:24 +01:00
|
|
|
parent.updateSetting("at_marks_en",at_marks_del.checked, at_marks_del)
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
2018-07-26 20:51:46 +02:00
|
|
|
}
|
2018-07-28 14:12:55 +02:00
|
|
|
|
2019-03-29 19:15:20 +01:00
|
|
|
InputDelegate {
|
2018-07-28 14:12:55 +02:00
|
|
|
id: at_marks_delay_del
|
2018-08-28 23:03:35 +02:00
|
|
|
|
2018-07-28 14:12:55 +02:00
|
|
|
width: parent.width
|
2019-03-29 19:15:20 +01:00
|
|
|
height: options_stack.delegateHeight
|
2018-08-11 23:54:34 +02:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
text: qsTr("Delay (ms)")
|
2019-03-29 23:42:56 +01:00
|
|
|
inputHint: qsTr("time")
|
|
|
|
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
2018-07-28 14:12:55 +02:00
|
|
|
|
2019-03-29 19:15:20 +01:00
|
|
|
enabled: at_marks_del.checked
|
2018-07-28 14:12:55 +02:00
|
|
|
|
2019-03-29 19:15:20 +01:00
|
|
|
inputText: autostart_col.loadSetting("at_marks_delay", at_marks_delay_del)
|
2018-07-28 14:12:55 +02:00
|
|
|
|
2019-04-08 18:03:23 +02:00
|
|
|
onInputFinished: {
|
2019-03-29 19:15:20 +01:00
|
|
|
autostart_col.updateSetting("at_marks_delay", inputText, at_marks_delay_del)
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-19 15:14:11 +02:00
|
|
|
/*-----Page to connect to the base station -----*/
|
2019-03-29 23:42:56 +01:00
|
|
|
Component {
|
|
|
|
id: connect
|
|
|
|
Column {
|
|
|
|
id: connectCol
|
|
|
|
property string title: qsTr("Base Station")
|
|
|
|
|
|
|
|
spacing: options_stack.rowSpacing
|
|
|
|
|
2019-04-08 18:21:43 +02:00
|
|
|
property bool baseConnected: speedBackend.baseStationState === "connected"
|
2019-03-29 23:42:56 +01:00
|
|
|
|
|
|
|
ConnectionDelegate {
|
|
|
|
id: connectToBaseDel
|
2019-09-22 16:07:41 +02:00
|
|
|
text: status.status === "connected" ? qsTr("Disconnect"): status.status === "disconnected" ? qsTr("Connect"):qsTr("Connecting...")
|
2019-03-29 23:42:56 +01:00
|
|
|
|
2019-08-20 22:55:37 +02:00
|
|
|
status: { "status": speedBackend.baseStationState, "progress": 100 }
|
2019-03-29 23:42:56 +01:00
|
|
|
connect: speedBackend.connectBaseStation
|
|
|
|
disconnect: speedBackend.disconnectBaseStation
|
|
|
|
type: "baseStation"
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
height: options_stack.delegateHeight
|
|
|
|
}
|
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
Loader {
|
|
|
|
id: baseStationOptionsLd
|
2019-03-29 23:42:56 +01:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
property alias parentComp: connectCol
|
|
|
|
property alias baseConnected: connectCol.baseConnected
|
2019-03-29 23:42:56 +01:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
onBaseConnectedChanged: {
|
|
|
|
disappearAnim.start()
|
|
|
|
}
|
2019-03-29 23:42:56 +01:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
Component.onCompleted: {
|
|
|
|
baseStationOptionsLd.sourceComponent = connectCol.baseConnected ? baseStationConnectedOptionsComp : baseStationDisconnectedOptionsComp
|
|
|
|
item.opacity = 1
|
|
|
|
item.scale = 1
|
2019-03-29 23:42:56 +01:00
|
|
|
}
|
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
sourceComponent: null
|
|
|
|
|
|
|
|
ParallelAnimation {
|
|
|
|
id: disappearAnim
|
|
|
|
|
|
|
|
NumberAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
to: 0
|
|
|
|
duration: 100
|
|
|
|
target: baseStationOptionsLd.item
|
|
|
|
}
|
|
|
|
|
|
|
|
NumberAnimation {
|
|
|
|
property: "scale"
|
|
|
|
to: 0.95
|
|
|
|
duration: 100
|
|
|
|
target: baseStationOptionsLd.item
|
|
|
|
}
|
|
|
|
|
|
|
|
onRunningChanged: {
|
|
|
|
if(!running) {
|
|
|
|
baseStationOptionsLd.sourceComponent = connectCol.baseConnected ? baseStationConnectedOptionsComp : baseStationDisconnectedOptionsComp
|
|
|
|
appearAnim.start()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ParallelAnimation {
|
|
|
|
id: appearAnim
|
2019-04-08 18:03:23 +02:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
NumberAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 0
|
|
|
|
to: 1
|
|
|
|
duration: 100
|
|
|
|
target: baseStationOptionsLd.item
|
|
|
|
}
|
2019-04-08 18:03:23 +02:00
|
|
|
|
|
|
|
NumberAnimation {
|
2019-09-22 16:07:41 +02:00
|
|
|
property: "scale"
|
|
|
|
from: 0.95
|
|
|
|
to: 1
|
|
|
|
duration: 100
|
|
|
|
target: baseStationOptionsLd.item
|
2019-04-08 18:03:23 +02:00
|
|
|
}
|
|
|
|
}
|
2019-09-22 16:07:41 +02:00
|
|
|
|
2019-04-08 18:03:23 +02:00
|
|
|
}
|
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
Component {
|
|
|
|
id: baseStationDisconnectedOptionsComp
|
2019-04-08 18:03:23 +02:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
Column {
|
|
|
|
id: baseStationDisconnectedOptions
|
2019-04-08 18:03:23 +02:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
width: parentComp.width
|
2019-03-29 23:42:56 +01:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
opacity: 0 // opacity and scale are adjusted by baseStationOptionsLd
|
|
|
|
scale: 0.95
|
2019-03-29 23:42:56 +01:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
InputDelegate {
|
|
|
|
id: baseStationIpDel
|
2019-04-08 18:03:23 +02:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
text: qsTr("IP")
|
2019-04-08 18:03:23 +02:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
inputHint: "IP"
|
|
|
|
inputText: speedBackend.readSetting("baseStationIpAdress")
|
|
|
|
inputTextFieldWidth: width * 0.7
|
2019-04-08 18:03:23 +02:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
onInputTextChanged: {
|
|
|
|
speedBackend.writeSetting("baseStationIpAdress", inputText)
|
|
|
|
speedBackend.reloadBaseStationIpAdress()
|
|
|
|
}
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
height: options_stack.delegateHeight
|
|
|
|
|
|
|
|
visible: height > 5
|
|
|
|
|
|
|
|
Behavior on height {
|
|
|
|
NumberAnimation {
|
|
|
|
duration: 400
|
|
|
|
easing.type: Easing.Linear
|
|
|
|
}
|
2019-04-08 18:03:23 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
SmoothItemDelegate {
|
|
|
|
id: baseStationHelpDel
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
height: options_stack.delegateHeight
|
|
|
|
|
|
|
|
text: qsTr("What is this for?")
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
Qt.openUrlExternally("https://itsblue.de/index.php/speed-climbing?ref=ScStwApp")
|
|
|
|
}
|
2019-03-29 23:42:56 +01:00
|
|
|
}
|
2019-09-22 16:07:41 +02:00
|
|
|
|
2019-03-29 23:42:56 +01:00
|
|
|
}
|
2019-09-22 16:07:41 +02:00
|
|
|
|
2019-03-29 23:42:56 +01:00
|
|
|
}
|
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
Component {
|
|
|
|
id: baseStationConnectedOptionsComp
|
2019-03-29 23:42:56 +01:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
Column {
|
|
|
|
id: baseStationConnectedOptions
|
2019-03-29 23:42:56 +01:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
width: parentComp.width
|
2019-03-29 23:42:56 +01:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
opacity: 0 // opacity and scale are adjusted by baseStationOptionsLd
|
|
|
|
scale: 0.95
|
2019-03-29 23:42:56 +01:00
|
|
|
|
2019-09-22 16:07:41 +02:00
|
|
|
SmoothSliderDelegate {
|
|
|
|
id: baseStationVolumeDel
|
|
|
|
text: qsTr("Volume")
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
height: options_stack.delegateHeight
|
|
|
|
|
|
|
|
sliderValue: 0
|
|
|
|
|
|
|
|
onSliderFinished: {
|
|
|
|
speedBackend.writeSetting("soundVolume", sliderValue)
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
var val = speedBackend.readSetting("soundVolume")
|
|
|
|
console.log(val)
|
|
|
|
if(val !== "false"){
|
|
|
|
sliderValue = parseFloat(val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Behavior on height {
|
|
|
|
NumberAnimation {
|
|
|
|
duration: 400
|
|
|
|
easing.type: Easing.Linear
|
|
|
|
}
|
|
|
|
}
|
2019-03-29 23:42:56 +01:00
|
|
|
}
|
2019-09-22 16:07:41 +02:00
|
|
|
|
|
|
|
NextPageDelegate {
|
|
|
|
id: baseStationConnectionsDel
|
|
|
|
text: qsTr("Connected extensions")
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
height: options_stack.delegateHeight
|
|
|
|
|
|
|
|
visible: height > 5
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
options_stack.push(baseStationConnections)
|
|
|
|
}
|
|
|
|
|
|
|
|
Behavior on height {
|
|
|
|
NumberAnimation {
|
|
|
|
duration: 400
|
|
|
|
easing.type: Easing.Linear
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-29 23:42:56 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-04 18:35:29 +02:00
|
|
|
/*-----Page to view devices that core connected to the pase startion-----*/
|
|
|
|
Component{
|
|
|
|
id: baseStationConnections
|
2019-03-07 17:18:24 +01:00
|
|
|
ListView {
|
|
|
|
id: baseStationConnections_list
|
2019-03-29 19:15:20 +01:00
|
|
|
|
2019-03-07 17:18:24 +01:00
|
|
|
property string title: qsTr("connections")
|
2019-03-27 22:24:59 +01:00
|
|
|
|
2019-03-29 19:15:20 +01:00
|
|
|
spacing: options_stack.rowSpacing
|
2019-03-27 22:24:59 +01:00
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
|
2019-03-07 17:18:24 +01:00
|
|
|
model: speedBackend.baseStationConnections.length
|
|
|
|
delegate: ConnectionDelegate {
|
2019-03-29 23:42:56 +01:00
|
|
|
|
|
|
|
opacity: 1
|
|
|
|
|
2019-03-07 17:18:24 +01:00
|
|
|
width: parent.width
|
2019-03-29 19:15:20 +01:00
|
|
|
height: options_stack.delegateHeight
|
|
|
|
|
2019-03-07 17:18:24 +01:00
|
|
|
text: speedBackend.baseStationConnections[index]["name"]
|
|
|
|
status: {'status': speedBackend.baseStationConnections[index]["state"], 'progress': speedBackend.baseStationConnections[index]["progress"]}
|
2018-10-04 18:35:29 +02:00
|
|
|
}
|
2019-03-07 17:18:24 +01:00
|
|
|
}
|
2018-09-23 17:54:20 +02:00
|
|
|
}
|
|
|
|
|
2018-07-28 14:12:55 +02:00
|
|
|
/*-----Custom animations-----*/
|
|
|
|
|
|
|
|
pushEnter: Transition {
|
|
|
|
NumberAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 0
|
|
|
|
to: 1
|
2019-03-27 22:24:59 +01:00
|
|
|
duration: 300
|
2018-07-28 14:12:55 +02:00
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
}
|
2019-05-03 22:54:32 +02:00
|
|
|
|
|
|
|
NumberAnimation {
|
|
|
|
property: "x"
|
|
|
|
from: width * 0.1
|
|
|
|
to: 0
|
|
|
|
duration: 300
|
|
|
|
}
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
|
|
|
pushExit: Transition {
|
|
|
|
NumberAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 1
|
|
|
|
to: 0
|
2019-03-27 22:24:59 +01:00
|
|
|
duration: 300
|
2018-07-28 14:12:55 +02:00
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
}
|
2019-05-03 22:54:32 +02:00
|
|
|
|
|
|
|
NumberAnimation {
|
|
|
|
property: "x"
|
|
|
|
to: -width * 0.1
|
|
|
|
from: 0
|
|
|
|
duration: 300
|
|
|
|
}
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
popExit: Transition {
|
|
|
|
NumberAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 1
|
|
|
|
to: 0
|
2019-03-27 22:24:59 +01:00
|
|
|
duration: 300
|
2018-07-28 14:12:55 +02:00
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
}
|
2019-05-03 22:54:32 +02:00
|
|
|
NumberAnimation {
|
|
|
|
property: "x"
|
|
|
|
to: width * 0.1
|
|
|
|
from: 0
|
|
|
|
duration: 300
|
|
|
|
}
|
2018-07-28 14:12:55 +02:00
|
|
|
}
|
|
|
|
popEnter: Transition {
|
|
|
|
NumberAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 0
|
|
|
|
to: 1
|
2019-03-27 22:24:59 +01:00
|
|
|
duration: 300
|
2018-07-28 14:12:55 +02:00
|
|
|
easing.type: Easing.InOutQuad
|
2018-07-25 00:32:20 +02:00
|
|
|
}
|
2019-05-03 22:54:32 +02:00
|
|
|
NumberAnimation {
|
|
|
|
property: "x"
|
|
|
|
from: -width * 0.1
|
|
|
|
to: 0
|
|
|
|
duration: 300
|
|
|
|
}
|
2018-07-25 00:32:20 +02:00
|
|
|
}
|
|
|
|
}
|
2018-07-28 14:12:55 +02:00
|
|
|
|
|
|
|
|
2018-07-25 00:32:20 +02:00
|
|
|
}
|