- startlists are now supported
- displaying errors at the top bar instead of the whole screen
This commit is contained in:
parent
ebab8b7cd8
commit
4971d6e9b1
9 changed files with 286 additions and 88 deletions
|
@ -22,73 +22,73 @@ Item {
|
||||||
color: "white"
|
color: "white"
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
|
||||||
// anchors {
|
|
||||||
// top: parent.top
|
|
||||||
// left: parent.left
|
|
||||||
// right: parent.right
|
|
||||||
// topMargin: -60
|
|
||||||
// }
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: errorField
|
id: errorField
|
||||||
|
|
||||||
|
property int errorCode: app.errorCode
|
||||||
|
|
||||||
|
onErrorCodeChanged: {
|
||||||
|
console.log("new error code: " + errorCode)
|
||||||
|
if(!([-1, 200, 905].indexOf(app.errorCode) >= 0) && control.showErrorBar){
|
||||||
|
animateErrorBar.start()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 30
|
height: 0
|
||||||
enabled: app.is_error & app.state !== "notLoggedIn" & control.showErrorBar
|
|
||||||
anchors.top: parent.bottom
|
anchors.top: parent.bottom
|
||||||
|
|
||||||
color: "red"
|
color: app.getErrorInfo(errorCode)[0] > 0 ? app.getErrorInfo(errorCode)[0] > 1 ? "red":"grey" : "green"
|
||||||
onEnabledChanged: {
|
|
||||||
if(enabled){
|
SequentialAnimation {
|
||||||
toolBar.state = 'moveIn'
|
id: animateErrorBar
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
target: errorField
|
||||||
|
property: "height"
|
||||||
|
duration: 200
|
||||||
|
from: 0
|
||||||
|
to: 30
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
toolBar.state = 'moveOut'
|
|
||||||
|
PauseAnimation {
|
||||||
|
duration: 1300
|
||||||
|
}
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
target: errorField
|
||||||
|
property: "height"
|
||||||
|
duration: 200
|
||||||
|
from: 30
|
||||||
|
to: 0
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
}
|
||||||
|
|
||||||
|
onRunningChanged: {
|
||||||
|
if(!running){
|
||||||
|
app.errorCode = -1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea { anchors.fill: parent; onClicked: {
|
Label {
|
||||||
toolBar.state = 'moveOut'
|
|
||||||
|
|
||||||
console.log("clicked")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
anchors {
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
id: errorText
|
id: errorText
|
||||||
font.family: "Helvetica"
|
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
color: "White"
|
color: "White"
|
||||||
font.pointSize: 8
|
|
||||||
|
font.pixelSize: height * 0.5
|
||||||
|
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
||||||
visible: parent.height !== 0
|
visible: parent.height !== 0
|
||||||
text: ""
|
|
||||||
|
text: app.getErrorInfo(errorField.errorCode)[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "moveOut"
|
|
||||||
PropertyChanges { target: errorField; height: 0 }
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "moveIn"
|
|
||||||
PropertyChanges { target: errorField; height: 30 }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
to: "moveOut"
|
|
||||||
NumberAnimation { properties: "height"; easing.type: Easing.InOutQuad; duration: 200 }
|
|
||||||
},
|
|
||||||
Transition {
|
|
||||||
to: "moveIn"
|
|
||||||
NumberAnimation { properties: "height"; easing.type: Easing.InOutQuad; duration: 200 }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ ListView {
|
||||||
anchors.rightMargin: 14
|
anchors.rightMargin: 14
|
||||||
|
|
||||||
|
|
||||||
enabled: status === 200
|
enabled: status === 200 || status === 902
|
||||||
opacity: enabled ? 1:0
|
opacity: enabled ? 1:0
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,10 @@ DataListView {
|
||||||
fontSizeMode: Text.Fit
|
fontSizeMode: Text.Fit
|
||||||
font.bold: false
|
font.bold: false
|
||||||
font.pixelSize: Math.abs( partDelSecondRow.height > 0 ? height * 0.4:height * 0.3 )
|
font.pixelSize: Math.abs( partDelSecondRow.height > 0 ? height * 0.4:height * 0.3 )
|
||||||
minimumPixelSize: 0
|
minimumPixelSize: height * 0.3
|
||||||
|
|
||||||
|
elide: "ElideRight"
|
||||||
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
||||||
|
@ -116,6 +119,7 @@ DataListView {
|
||||||
if( resultString !== undefined){
|
if( resultString !== undefined){
|
||||||
resultString = resultString.replace("t", "")
|
resultString = resultString.replace("t", "")
|
||||||
resultString = resultString.replace("z", "")
|
resultString = resultString.replace("z", "")
|
||||||
|
resultString = resultString.replace("b", "")
|
||||||
resultList = resultString.split(" ")
|
resultList = resultString.split(" ")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,23 @@ DataListView {
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
text: control.getText(index)
|
text: ""
|
||||||
|
|
||||||
|
Label {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: width * 0.05
|
||||||
|
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
||||||
|
fontSizeMode: Text.Fit
|
||||||
|
font.bold: true
|
||||||
|
font.pixelSize: Math.abs( height * 0.4 )
|
||||||
|
minimumPixelSize: height * 0.3
|
||||||
|
|
||||||
|
elide: "ElideRight"
|
||||||
|
|
||||||
|
text: control.getText(index)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getText(index){
|
function getText(index){
|
||||||
|
|
|
@ -1,5 +1,73 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 2.4
|
||||||
|
|
||||||
Item {
|
DataListView {
|
||||||
|
id: control
|
||||||
|
|
||||||
|
property var listData: ({})
|
||||||
|
|
||||||
|
model: listData[ root.listKey ] === undefined ? 0:listData[ root.listKey ].length
|
||||||
|
|
||||||
|
delegate: ItemDelegate {
|
||||||
|
id: partDel
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
text: ""
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: partDelFirstRow
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
|
||||||
|
Label {
|
||||||
|
height: parent.height
|
||||||
|
width: parent.width * 0.1
|
||||||
|
|
||||||
|
fontSizeMode: Text.Fit
|
||||||
|
font.bold: true
|
||||||
|
font.pixelSize: Math.abs( height * 0.6 )
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
||||||
|
text: listData[ "participants" ][index]["start_order"]
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
height: parent.height
|
||||||
|
width: parent.width * 0.4
|
||||||
|
|
||||||
|
fontSizeMode: Text.Fit
|
||||||
|
font.bold: true
|
||||||
|
font.pixelSize: Math.abs( height * 0.6 )
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
|
||||||
|
text: listData[ "participants" ][index]["firstname"] + " " + listData[ "participants" ][index]["lastname"]
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
height: parent.height
|
||||||
|
width: parent.width * 0.5
|
||||||
|
|
||||||
|
fontSizeMode: Text.Fit
|
||||||
|
font.bold: false
|
||||||
|
font.pixelSize: Math.abs( height * 0.4 )
|
||||||
|
minimumPixelSize: height * 0.3
|
||||||
|
|
||||||
|
elide: "ElideRight"
|
||||||
|
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
||||||
|
text: "<html>(<a href=\"" + (listData[ "participants" ][index]["url"] === undefined ? "":listData[ "participants" ][index]["url"]).toString() + "\">" + (listData[ "display_athlete" ] === "nation" ? listData[ "participants" ][index]["nation"] : listData[ "participants" ][index]["federation"]) + "</a>)</html>"
|
||||||
|
|
||||||
|
onLinkActivated: {
|
||||||
|
Qt.openUrlExternally(link)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,15 +7,18 @@ import "../Components"
|
||||||
Page {
|
Page {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
title: "calendar"
|
title: (nation === "" ? "IFSC":nation === "GER" ? "DAV":"SAC") + " " + qsTr("competition calendar")
|
||||||
|
|
||||||
|
property bool ready
|
||||||
|
|
||||||
property Component headerComponent: Item {
|
property Component headerComponent: Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.rightMargin: parent.width * 0.05
|
||||||
|
|
||||||
spacing: width * 0.05
|
spacing: anchors.rightMargin
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
@ -25,6 +28,8 @@ Page {
|
||||||
|
|
||||||
fontSizeMode: Text.Fit
|
fontSizeMode: Text.Fit
|
||||||
font.pixelSize: height
|
font.pixelSize: height
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
minimumPixelSize: 0
|
minimumPixelSize: 0
|
||||||
|
|
||||||
text: root.year
|
text: root.year
|
||||||
|
@ -72,13 +77,16 @@ Page {
|
||||||
property var calendarData
|
property var calendarData
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
loadData(root.nation, root.year)
|
root.ready = loadData(root.nation, root.year)
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadData(nation, year) {
|
function loadData(nation, year) {
|
||||||
root.status = 905
|
|
||||||
loadingDl.open()
|
loadingDl.open()
|
||||||
|
|
||||||
|
//console.log("loading calendar data and old data is: " + (root.calendarData !== undefined) + " because of: " + root.calendarData + " and: ")
|
||||||
|
|
||||||
|
root.status = 905
|
||||||
|
|
||||||
var ret = serverConn.getCalendar(nation, year)
|
var ret = serverConn.getCalendar(nation, year)
|
||||||
|
|
||||||
if(ret["status"] === 200){
|
if(ret["status"] === 200){
|
||||||
|
@ -86,12 +94,25 @@ Page {
|
||||||
root.calendarData = ret["data"]
|
root.calendarData = ret["data"]
|
||||||
calendarList.listData = ret["data"]["competitions"]
|
calendarList.listData = ret["data"]["competitions"]
|
||||||
}
|
}
|
||||||
|
else if (root.calendarData !== undefined ){
|
||||||
|
// there is still old data available
|
||||||
|
root.status = 902
|
||||||
|
//console.log("old data")
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
root.status = parseInt(ret["status"])
|
root.status = parseInt(ret["status"])
|
||||||
calendarList.listData = {}
|
app.errorCode = parseInt(ret["status"])
|
||||||
root.calendarData = {}
|
root.calendarData = ({})
|
||||||
|
calendarList.listData = ({})
|
||||||
|
//console.log("error: " + root.status)
|
||||||
|
loadingDl.close()
|
||||||
|
app.errorCode = root.status
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
loadingDl.close()
|
loadingDl.close()
|
||||||
|
app.errorCode = root.status
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
DataListView {
|
DataListView {
|
||||||
|
@ -233,7 +254,7 @@ Page {
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
catSelectPu.close()
|
catSelectPu.close()
|
||||||
app.openResults(calendarList.listData[catSelectPu.index]["WetId"], catSelectPu.catObj[index]["GrpId"], (catSelectPu.catObj[index]["status"] === 4 || catSelectPu.catObj[index]["status"] === undefined))
|
app.openResults(calendarList.listData[catSelectPu.index]["WetId"], catSelectPu.catObj[index]["GrpId"], catSelectPu.catObj[index]["status"] )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,7 +283,7 @@ Page {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: root.height * 0.6
|
height: root.height * 0.6
|
||||||
|
|
||||||
model: yearSelectPu.yearList.length
|
model: yearSelectPu.yearList !== undefined ? yearSelectPu.yearList.length:0
|
||||||
|
|
||||||
delegate: Button {
|
delegate: Button {
|
||||||
id: yearBt
|
id: yearBt
|
||||||
|
|
|
@ -11,14 +11,19 @@ Page {
|
||||||
property string subTitle: getSubtitle()
|
property string subTitle: getSubtitle()
|
||||||
property bool titleIsPageTitle: true
|
property bool titleIsPageTitle: true
|
||||||
|
|
||||||
|
property bool ready
|
||||||
property int status: -1
|
property int status: -1
|
||||||
|
|
||||||
property bool debug: true
|
property bool debug: true
|
||||||
|
|
||||||
property int comId: -1
|
property int comId: -1
|
||||||
property int catId: -1
|
property int catId: -1
|
||||||
|
property int catStatus: undefined
|
||||||
property int routeNumber: -2
|
property int routeNumber: -2
|
||||||
property bool reg: false
|
|
||||||
|
property bool reg: catStatus === 4 || catStatus === undefied // registration data
|
||||||
|
property bool res: catStatus === 0 || catStatus === 1 // result data
|
||||||
|
property bool stl: catStatus === 2 || catStatus === 3 // startlist data
|
||||||
|
|
||||||
property var rankingData
|
property var rankingData
|
||||||
|
|
||||||
|
@ -30,8 +35,8 @@ Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadData(comp, cat, reg, route){
|
function loadData(comp, cat, reg, route){
|
||||||
root.status = 905
|
|
||||||
loadingDl.open()
|
loadingDl.open()
|
||||||
|
root.status = 905
|
||||||
console.log("[info][QML] getting ranking data of comp: " + comp + " and cat: " + cat + " reg: " + reg)
|
console.log("[info][QML] getting ranking data of comp: " + comp + " and cat: " + cat + " reg: " + reg)
|
||||||
var ret = serverConn.getRanking(comp, cat, reg, route)
|
var ret = serverConn.getRanking(comp, cat, reg, route)
|
||||||
|
|
||||||
|
@ -59,17 +64,29 @@ Page {
|
||||||
root.routeNumber = root.rankingData["route_order"] === undefined ? -2:root.rankingData["route_order"]
|
root.routeNumber = root.rankingData["route_order"] === undefined ? -2:root.rankingData["route_order"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if(root.rankingData !== undefined){
|
||||||
root.rankingData = {}
|
root.status = 902
|
||||||
|
app.errorCode = 902
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if((ret["data"][ root.listKey ] === undefined || ret["data"][ root.listKey ].length < 1) && ( root.status === 200 || root.status === 404 ) ){
|
||||||
if((ret["data"][ root.listKey ] === undefined || ret["data"][ root.listKey ].length < 1) && ( root.status === 200 || root.status === 404 ) ){
|
|
||||||
root.status = 901
|
root.status = 901
|
||||||
|
root.ready = false
|
||||||
|
loadingDl.close()
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
root.ready = false
|
||||||
|
root.rankingData = {}
|
||||||
|
loadingDl.close()
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("done! status: " + root.status)
|
console.log("done! status: " + root.status)
|
||||||
|
root.ready = true
|
||||||
loadingDl.close()
|
loadingDl.close()
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSubtitle() {
|
function getSubtitle() {
|
||||||
|
@ -89,7 +106,19 @@ Page {
|
||||||
titleString = root.rankingData["route_name"]
|
titleString = root.rankingData["route_name"]
|
||||||
}
|
}
|
||||||
|
|
||||||
return titleString
|
var addition = ""
|
||||||
|
|
||||||
|
if(root.reg) {
|
||||||
|
addition = "(Registration) "
|
||||||
|
}
|
||||||
|
else if(root.res) {
|
||||||
|
addition = "(Results) "
|
||||||
|
}
|
||||||
|
else if(root.stl) {
|
||||||
|
addition = "(Startlist) "
|
||||||
|
}
|
||||||
|
|
||||||
|
return addition + titleString
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +151,7 @@ Page {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
visible: !root.reg
|
visible: root.res
|
||||||
|
|
||||||
RankingView {
|
RankingView {
|
||||||
id: rankViewRv
|
id: rankViewRv
|
||||||
|
@ -237,4 +266,28 @@ Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: startlItm
|
||||||
|
// item for startlist data
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
visible: root.stl
|
||||||
|
|
||||||
|
StartlistView {
|
||||||
|
id: stlViewRv
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
status: root.status
|
||||||
|
|
||||||
|
listData: root.stl ? root.rankingData:({})
|
||||||
|
|
||||||
|
onRefresh: {
|
||||||
|
root.loadData(root.comId, root.catId, root.reg, root.routeNumber)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,8 @@ Window {
|
||||||
Page {
|
Page {
|
||||||
id: app
|
id: app
|
||||||
|
|
||||||
|
property int errorCode: -1
|
||||||
|
|
||||||
property var competitionCategoryColors: {
|
property var competitionCategoryColors: {
|
||||||
"61": "lightgrey",
|
"61": "lightgrey",
|
||||||
"58": "lightgreen",
|
"58": "lightgreen",
|
||||||
|
@ -49,6 +51,8 @@ Window {
|
||||||
StackView {
|
StackView {
|
||||||
id: mainStack
|
id: mainStack
|
||||||
|
|
||||||
|
enabled: !loadingDl.opened
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: toolBar.bottom
|
top: toolBar.bottom
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
@ -107,11 +111,13 @@ Window {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
topMargin: -60
|
topMargin: -height
|
||||||
}
|
}
|
||||||
|
|
||||||
height: 50
|
height: 50
|
||||||
|
|
||||||
|
showErrorBar: true
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -163,14 +169,17 @@ Window {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
width: parent.width * 0.7
|
width: parent.width - extraComponentLoader.width - toolButton.width - 3 * parent.spacing
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
id: toolBarTitleLa
|
id: toolBarTitleLa
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
elide: "ElideRight"
|
elide: "ElideRight"
|
||||||
|
|
||||||
font.bold: true
|
font.bold: true
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
||||||
color: "black"
|
color: "black"
|
||||||
|
|
||||||
|
@ -199,7 +208,8 @@ Window {
|
||||||
Label {
|
Label {
|
||||||
id: toolBarSubTitleLa
|
id: toolBarSubTitleLa
|
||||||
|
|
||||||
elide: "ElideRight"
|
width: parent.width
|
||||||
|
height: text !== "" ? undefined:0
|
||||||
|
|
||||||
font.bold: false
|
font.bold: false
|
||||||
|
|
||||||
|
@ -224,7 +234,7 @@ Window {
|
||||||
id: extraComponentLoader
|
id: extraComponentLoader
|
||||||
|
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: parent.width * 0.2 - toolButton.width
|
width: status === Loader.Ready ? parent.width * 0.35 - toolButton.width - 3 * parent.spacing:0
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
|
@ -249,7 +259,7 @@ Window {
|
||||||
when: mainStack.depth === 1
|
when: mainStack.depth === 1
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: toolBar
|
target: toolBar
|
||||||
anchors.topMargin: -60
|
anchors.topMargin: -height
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
|
@ -294,19 +304,39 @@ Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
function openCalendar(nation){
|
function openCalendar(nation){
|
||||||
loadingDl.open()
|
//loadingDl.open()
|
||||||
mainStack.push(Qt.createComponent("qrc:/Pages/CompetitionCalendarPage.qml").createObject(null, {"nation": nation}))
|
|
||||||
loadingDl.close()
|
var calComp = Qt.createComponent("qrc:/Pages/CompetitionCalendarPage.qml").createObject(null, {"nation": nation})
|
||||||
|
app.errorCode = calComp.status
|
||||||
|
if(calComp.ready){
|
||||||
|
mainStack.push(calComp)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
delete(calComp)
|
||||||
|
}
|
||||||
|
|
||||||
|
//loadingDl.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
function openResults(comp, cat, reg){
|
function openResults(comp, cat, status){
|
||||||
// comp: (int) competiotion ID
|
// comp: (int) competiotion ID
|
||||||
// cat: (int) category ID
|
// cat: (int) category ID
|
||||||
// reg: (bool) false: results; true: registrations
|
// reg: (int) 0: result imported into ranking; 1: result-service result available; 2: result-service startlist available; 3: old non result-server startlist (no longer used); 4: starters / registration data
|
||||||
|
|
||||||
//loadingDl.open()
|
loadingDl.open()
|
||||||
mainStack.push(Qt.createComponent("qrc:/Pages/RankingPage.qml").createObject(null, {"comId": comp, "catId": cat, "reg": reg}))
|
|
||||||
//loadingDl.close()
|
var rankComp = Qt.createComponent("qrc:/Pages/RankingPage.qml").createObject(null, {"comId": comp, "catId": cat, "catStatus": status})
|
||||||
|
app.errorCode = rankComp.status
|
||||||
|
|
||||||
|
if(rankComp.ready){
|
||||||
|
mainStack.push(rankComp)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
delete(rankComp)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
loadingDl.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
function getErrorInfo(errorCode) {
|
function getErrorInfo(errorCode) {
|
||||||
|
@ -325,6 +355,11 @@ Window {
|
||||||
errorString = "No connection to server"
|
errorString = "No connection to server"
|
||||||
errorDescription = "Please check your internet connection and try again."
|
errorDescription = "Please check your internet connection and try again."
|
||||||
break
|
break
|
||||||
|
case 200:
|
||||||
|
infoLevel = 0
|
||||||
|
errorString = "Success"
|
||||||
|
errorDescription = "The request was successfull"
|
||||||
|
break
|
||||||
case 401:
|
case 401:
|
||||||
infoLevel = 2
|
infoLevel = 2
|
||||||
errorString = "Authentication required"
|
errorString = "Authentication required"
|
||||||
|
@ -347,7 +382,7 @@ Window {
|
||||||
break
|
break
|
||||||
case 902:
|
case 902:
|
||||||
infoLevel = 1
|
infoLevel = 1
|
||||||
errorString = "Alte Daten"
|
errorString = "Cached (old) data"
|
||||||
errorDescription = "Es konnte keine Verbindung zum Server hergestellt werden, aber es sind noch alte Daten gespeichert."
|
errorDescription = "Es konnte keine Verbindung zum Server hergestellt werden, aber es sind noch alte Daten gespeichert."
|
||||||
break
|
break
|
||||||
case 903:
|
case 903:
|
||||||
|
|
|
@ -11,5 +11,6 @@
|
||||||
<file>Components/DataListView.qml</file>
|
<file>Components/DataListView.qml</file>
|
||||||
<file>Components/RankingView.qml</file>
|
<file>Components/RankingView.qml</file>
|
||||||
<file>Components/RegistrationView.qml</file>
|
<file>Components/RegistrationView.qml</file>
|
||||||
|
<file>Components/StartlistView.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
Loading…
Reference in a new issue