2018-10-14 18:39:09 +02:00
|
|
|
import QtQuick 2.9
|
|
|
|
import QtQuick.Controls 2.2
|
|
|
|
import QtGraphicalEffects 1.0
|
2018-12-23 21:07:10 +01:00
|
|
|
import "../Components"
|
2018-10-14 18:39:09 +02:00
|
|
|
|
|
|
|
Page {
|
2018-12-23 00:06:05 +01:00
|
|
|
id: root
|
2018-10-14 18:39:09 +02:00
|
|
|
//anchors.fill: parent
|
2018-12-23 00:06:05 +01:00
|
|
|
property string day
|
2018-10-14 18:39:09 +02:00
|
|
|
title: qsTr("Vertretungsplan")
|
|
|
|
property string icon: "qrc:/graphics/FannyLogo_small.png"
|
|
|
|
property string link: "http://www.fanny-leicht.de/j34"
|
2018-12-23 21:07:10 +01:00
|
|
|
property int status: -1
|
2018-10-14 18:39:09 +02:00
|
|
|
|
2018-12-23 00:06:05 +01:00
|
|
|
signal opened()
|
|
|
|
|
|
|
|
onOpened: {
|
|
|
|
}
|
|
|
|
|
2018-12-27 11:30:12 +01:00
|
|
|
// Image{
|
|
|
|
// source: "qrc:/graphics/chat_background.jpg";
|
|
|
|
// height: parent.height
|
|
|
|
// width: parent.width
|
|
|
|
// fillMode: Image.Tile
|
|
|
|
// horizontalAlignment: Image.AlignLeft
|
|
|
|
// verticalAlignment: Image.AlignTop
|
|
|
|
// }
|
|
|
|
// LinearGradient {
|
|
|
|
// anchors.fill: parent
|
|
|
|
// start: Qt.point(0, 0)
|
|
|
|
// end: Qt.point(0, parent.height)
|
|
|
|
// gradient: Gradient {
|
|
|
|
// GradientStop { position: 0.0; color: "#4db2b3" }
|
|
|
|
// GradientStop { position: 1.0; color: "#8f4dae" }
|
|
|
|
// }
|
|
|
|
// }
|
2018-10-14 18:39:09 +02:00
|
|
|
|
2018-12-23 00:06:05 +01:00
|
|
|
Loader {
|
|
|
|
id: pageLoader
|
2018-12-27 11:30:12 +01:00
|
|
|
|
|
|
|
property string newSource: ""
|
|
|
|
|
|
|
|
onNewSourceChanged: {
|
|
|
|
oldItemAnimation.start()
|
|
|
|
}
|
|
|
|
|
2018-12-23 00:06:05 +01:00
|
|
|
anchors.fill: parent
|
|
|
|
source: "./LoadingForm.qml"
|
|
|
|
|
2018-12-27 11:30:12 +01:00
|
|
|
onSourceChanged: newItemAnimation.start()
|
2018-12-23 00:06:05 +01:00
|
|
|
|
|
|
|
NumberAnimation {
|
2018-12-27 11:30:12 +01:00
|
|
|
id: newItemAnimation
|
2018-12-27 15:01:05 +01:00
|
|
|
target: pageLoader.item
|
2018-12-23 00:06:05 +01:00
|
|
|
property: "opacity"
|
|
|
|
from: 0
|
2018-12-27 15:01:05 +01:00
|
|
|
to: 1
|
|
|
|
duration: 200
|
2018-12-23 00:06:05 +01:00
|
|
|
easing.type: Easing.InExpo
|
|
|
|
}
|
2018-12-27 11:30:12 +01:00
|
|
|
|
|
|
|
NumberAnimation {
|
|
|
|
id: oldItemAnimation
|
2018-12-27 15:01:05 +01:00
|
|
|
target: pageLoader.item
|
2018-12-27 11:30:12 +01:00
|
|
|
property: "opacity"
|
2018-12-27 15:01:05 +01:00
|
|
|
from: 1
|
2018-12-27 11:30:12 +01:00
|
|
|
to: 0
|
2018-12-27 15:01:05 +01:00
|
|
|
duration: 200
|
2018-12-27 11:30:12 +01:00
|
|
|
easing.type: Easing.InExpo
|
|
|
|
|
|
|
|
onRunningChanged: {
|
|
|
|
if(!running){
|
|
|
|
pageLoader.source = pageLoader.newSource
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: pageLoader.item
|
|
|
|
onRefresh: {
|
|
|
|
pageLoader.newSource = "./LoadingForm.qml"
|
|
|
|
loadTimer.start()
|
|
|
|
}
|
|
|
|
}
|
2018-12-23 00:06:05 +01:00
|
|
|
}
|
|
|
|
|
2018-10-14 18:39:09 +02:00
|
|
|
Timer {
|
2018-12-27 11:30:12 +01:00
|
|
|
id: loadTimer
|
2018-12-23 00:06:05 +01:00
|
|
|
interval: 500
|
2018-10-14 18:39:09 +02:00
|
|
|
running: true
|
|
|
|
repeat: false
|
|
|
|
onTriggered: {
|
2018-12-25 20:34:53 +01:00
|
|
|
status = serverConn.getEvents(day)
|
2018-12-27 11:30:12 +01:00
|
|
|
pageLoader.newSource = "../Components/EventView.qml"
|
2018-10-14 18:39:09 +02:00
|
|
|
}
|
|
|
|
}
|
2018-12-23 21:07:10 +01:00
|
|
|
|
|
|
|
InfoArea {
|
|
|
|
id: infoArea
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
top: parent.top
|
|
|
|
margins: app.landscape() ? parent.width * 0.4:parent.width * 0.3
|
2018-12-27 11:06:26 +01:00
|
|
|
topMargin: parent.height*( status === 901 ? 0.6:0.5) - height * 0.8
|
2018-12-23 21:07:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
errorCode: status
|
|
|
|
}
|
2018-10-14 18:39:09 +02:00
|
|
|
}
|