minor fixes
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<manifest package="com.itsblue.blueROCKtest" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.01.2b" android:versionCode="3" android:installLocation="auto">
|
<manifest package="com.itsblue.blueROCKtest" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.01.3b" android:versionCode="4" android:installLocation="auto">
|
||||||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="blueROCK" android:icon="@drawable/icon">
|
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="blueROCK" android:icon="@drawable/icon">
|
||||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="blueROCK (for digitalROCK)" android:screenOrientation="unspecified" android:launchMode="singleTop">
|
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="blueROCK (for digitalROCK)" android:screenOrientation="unspecified" android:launchMode="singleTop">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 138 KiB |
|
@ -67,15 +67,24 @@ Page {
|
||||||
|
|
||||||
var ret = serverConn.getWidgetData(params)
|
var ret = serverConn.getWidgetData(params)
|
||||||
|
|
||||||
|
root.status = ret["status"]
|
||||||
|
|
||||||
if(ret["status"] === 200){
|
if(ret["status"] === 200){
|
||||||
root.widgetData = ret["data"]
|
root.widgetData = ret["data"]
|
||||||
root.widgetType = checkWidgetType(params, root.widgetData)
|
root.widgetType = checkWidgetType(params, root.widgetData)
|
||||||
console.log(widgetType)
|
if(widgetLd.load()){
|
||||||
widgetLd.load()
|
|
||||||
root.ready = true
|
root.ready = true
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
root.status = 900
|
||||||
|
root.ready = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
root.ready = false
|
||||||
|
}
|
||||||
|
|
||||||
root.status = ret["status"]
|
app.errorCode = root.status
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +92,7 @@ Page {
|
||||||
if(openLoadingDl)
|
if(openLoadingDl)
|
||||||
loadingDl.open()
|
loadingDl.open()
|
||||||
|
|
||||||
|
// update all the given values
|
||||||
for(var prop in params){
|
for(var prop in params){
|
||||||
if(params.hasOwnProperty(prop)){
|
if(params.hasOwnProperty(prop)){
|
||||||
root.params[prop] = params[prop]
|
root.params[prop] = params[prop]
|
||||||
|
@ -98,7 +107,6 @@ Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkWidgetType(params, widgetData){
|
function checkWidgetType(params, widgetData){
|
||||||
|
|
||||||
var widgetType
|
var widgetType
|
||||||
|
|
||||||
function hasParam(object, key, value){
|
function hasParam(object, key, value){
|
||||||
|
@ -154,14 +162,34 @@ Page {
|
||||||
property alias selector: selectorPu
|
property alias selector: selectorPu
|
||||||
property var updateData: root.updateData
|
property var updateData: root.updateData
|
||||||
property alias params: root.params
|
property alias params: root.params
|
||||||
|
property alias currentWidgetData: root.widgetData
|
||||||
|
|
||||||
|
property var oldWidgetType: NaN
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
source: ""
|
source: ""
|
||||||
|
|
||||||
function load() {
|
function load() {
|
||||||
widgetLd.source = getFile(root.widgetType)
|
if(root.widgetType !== oldWidgetType){
|
||||||
widgetLd.item.widgetData = root.widgetData
|
oldWidgetType = root.widgetType
|
||||||
|
var calComp = Qt.createComponent(getFile(root.widgetType))//.createObject(null, {widgetData: root.widgetData, parent: widgetLd})
|
||||||
|
|
||||||
|
widgetLd.sourceComponent = calComp
|
||||||
|
//widgetLd.item.widgetData = root.widgetData
|
||||||
|
}
|
||||||
|
root.status = widgetLd.item.status
|
||||||
|
|
||||||
|
if(widgetLd.item.ready){
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
delete(widgetLd.sourceComponent = null)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFile(widgetType) {
|
function getFile(widgetType) {
|
||||||
|
@ -222,10 +250,12 @@ Page {
|
||||||
title: ""
|
title: ""
|
||||||
|
|
||||||
function appear(dataObj, title) {
|
function appear(dataObj, title) {
|
||||||
|
if(dataObj.length > 0){
|
||||||
selectorPu.dataObj = dataObj
|
selectorPu.dataObj = dataObj
|
||||||
selectorPu.title = title
|
selectorPu.title = title
|
||||||
selectorPu.open()
|
selectorPu.open()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: selectorLv
|
id: selectorLv
|
||||||
|
|
|
@ -24,38 +24,21 @@ import "../Components"
|
||||||
DataListView {
|
DataListView {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
property string title: (params.nation === "" ? "IFSC":params.nation === "GER" ? "DAV":"SAC") + " " + qsTr("competition calendar")
|
property bool ready
|
||||||
property Component headerComponent: Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
Row {
|
property string title: (params.nation === "" ? "IFSC":params.nation === "GER" ? "DAV":"SAC") + " " + qsTr("competition calendar") + " " + control.year
|
||||||
anchors.fill: parent
|
property Component headerComponent: Row {
|
||||||
anchors.rightMargin: 5
|
|
||||||
|
|
||||||
spacing: width * 0.05
|
anchors {
|
||||||
|
top: parent.top
|
||||||
Label {
|
bottom: parent.bottom
|
||||||
id: yearLa
|
right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
rightMargin: 5
|
||||||
|
|
||||||
width: parent.width * 0.4
|
|
||||||
height: parent.height * 0.6
|
|
||||||
|
|
||||||
fontSizeMode: Text.Fit
|
|
||||||
font.pixelSize: height
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
minimumPixelSize: 1
|
|
||||||
|
|
||||||
text: control.year
|
|
||||||
|
|
||||||
Behavior on text {
|
|
||||||
FadeAnimation {
|
|
||||||
target: yearLa
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
width: childrenRect.width
|
||||||
|
|
||||||
|
spacing: width * 0.1
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id:yearToolBt
|
id:yearToolBt
|
||||||
|
@ -65,7 +48,7 @@ DataListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
height: parent.height * 0.5
|
height: parent.height * 0.5
|
||||||
width: parent.width * 0.25
|
width: height
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
control.changeYear()
|
control.changeYear()
|
||||||
|
@ -102,7 +85,7 @@ DataListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
height: parent.height * 0.5
|
height: parent.height * 0.5
|
||||||
width: parent.width * 0.25
|
width: height
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
control.openCup()
|
control.openCup()
|
||||||
|
@ -131,10 +114,15 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
Item {
|
||||||
|
id: spacer
|
||||||
|
height: parent.height
|
||||||
|
width: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
property var widgetData
|
}
|
||||||
|
|
||||||
|
property var widgetData: currentWidgetData
|
||||||
|
|
||||||
property int year: new Date().getFullYear()
|
property int year: new Date().getFullYear()
|
||||||
|
|
||||||
|
@ -144,17 +132,22 @@ DataListView {
|
||||||
|
|
||||||
model: widgetData["competitions"].length
|
model: widgetData["competitions"].length
|
||||||
|
|
||||||
status: root.status
|
|
||||||
|
|
||||||
onRefresh: {
|
onRefresh: {
|
||||||
updateData({}, false)
|
updateData({}, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
onModelChanged: {
|
Component.onCompleted: {
|
||||||
autoScroll()
|
if(model > 0){
|
||||||
|
control.ready = true
|
||||||
|
control.status = 200
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
control.ready = false
|
||||||
|
control.status = 901
|
||||||
}
|
}
|
||||||
|
|
||||||
onWidgetDataChanged: {
|
autoScroll()
|
||||||
|
|
||||||
// if the IFSC Calendar is open -> add the worldranking
|
// if the IFSC Calendar is open -> add the worldranking
|
||||||
if(params.nation === ""){
|
if(params.nation === ""){
|
||||||
control.widgetData['cups'].unshift({"SerId":"","rkey":"","name":"Worldranking","modified":"2018-10-24 16:11:12","modifier":"","year":"","num_comps":"","cats":["ICC-COA","ICC-HD","ICC-MED","ICC_F","ICC_FB","ICC_FS","ICC_M","ICC_MB","ICC_MS"]})
|
control.widgetData['cups'].unshift({"SerId":"","rkey":"","name":"Worldranking","modified":"2018-10-24 16:11:12","modifier":"","year":"","num_comps":"","cats":["ICC-COA","ICC-HD","ICC-MED","ICC_F","ICC_FB","ICC_FS","ICC_M","ICC_MB","ICC_MS"]})
|
||||||
|
@ -162,9 +155,11 @@ DataListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoScroll() {
|
function autoScroll() {
|
||||||
|
// function to scroll to the next competition that is not already over
|
||||||
var compList = control.widgetData["competitions"]
|
var compList = control.widgetData["competitions"]
|
||||||
|
|
||||||
|
console.log("scrolling")
|
||||||
|
|
||||||
if(parseInt(control.year) === new Date().getFullYear()){
|
if(parseInt(control.year) === new Date().getFullYear()){
|
||||||
for(var i = 0; i < compList.length; i ++){
|
for(var i = 0; i < compList.length; i ++){
|
||||||
// get the start date pf the competition
|
// get the start date pf the competition
|
||||||
|
@ -186,6 +181,9 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
//console.log("not current year")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCompCatData(compCatId) {
|
function getCompCatData(compCatId) {
|
||||||
|
@ -293,7 +291,7 @@ DataListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: selector
|
target: parent.selector
|
||||||
onSelectionFinished: {
|
onSelectionFinished: {
|
||||||
if(data.comp !== undefined){
|
if(data.comp !== undefined){
|
||||||
console.log(data.status)
|
console.log(data.status)
|
||||||
|
@ -375,14 +373,14 @@ DataListView {
|
||||||
|
|
||||||
text: name
|
text: name
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
Label {
|
Label {
|
||||||
id: infola
|
id: infola
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
text: thisData.info
|
text: thisData.info
|
||||||
}*/
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
id: dateLa
|
id: dateLa
|
||||||
|
|
|
@ -14,7 +14,12 @@ Page {
|
||||||
|
|
||||||
property int perId: -1
|
property int perId: -1
|
||||||
|
|
||||||
property var widgetData: ({})
|
property var widgetData: currentWidgetData
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
control.ready = true
|
||||||
|
control.status = 200
|
||||||
|
}
|
||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
id: mainSv
|
id: mainSv
|
||||||
|
@ -334,7 +339,7 @@ Page {
|
||||||
text: "<html><a href='#'>" + bestResultsRep.bestResults[index]["name"] + "</a></html>"
|
text: "<html><a href='#'>" + bestResultsRep.bestResults[index]["name"] + "</a></html>"
|
||||||
|
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
app.openResults( bestResultsRep.bestResults[index]["WetId"], bestResultsRep.bestResults[index]["GrpId"], 1 )
|
app.openWidget( { comp: bestResultsRep.bestResults[index]["WetId"], cat: bestResultsRep.bestResults[index]["GrpId"] } )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,13 @@ import "../Components"
|
||||||
DataListView {
|
DataListView {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
|
property bool ready
|
||||||
|
|
||||||
property string title: control.widgetData['comp_name']
|
property string title: control.widgetData['comp_name']
|
||||||
property string subTitle: qsTr("(Ranking)") + " after " + control.widgetData['route_name']
|
property string subTitle: qsTr("(Ranking)") + " after " + control.widgetData['route_name']
|
||||||
property bool titleIsPageTitle: true
|
property bool titleIsPageTitle: true
|
||||||
|
|
||||||
property var widgetData: ({})
|
property var widgetData: currentWidgetData
|
||||||
signal closeAll()
|
signal closeAll()
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
@ -40,10 +42,22 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
onWidgetDataChanged: {
|
if(model > 0){
|
||||||
model = widgetData[ "participants" ] === undefined ? 0:widgetData[ "participants" ].length
|
control.ready = true
|
||||||
|
control.status = 200
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
control.ready = false
|
||||||
|
control.status = 901
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onRefresh: {
|
||||||
|
updateData({}, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
status: model === 0 ? 901:200
|
||||||
|
|
||||||
model: widgetData[ "participants" ] === undefined ? 0:widgetData[ "participants" ].length
|
model: widgetData[ "participants" ] === undefined ? 0:widgetData[ "participants" ].length
|
||||||
|
|
||||||
|
|
|
@ -24,21 +24,24 @@ import "../Components"
|
||||||
DataListView {
|
DataListView {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
property string title: control.widgetData['name']
|
property bool ready
|
||||||
|
|
||||||
|
property string title: control.widgetData['name'] === undefined ? "":control.widgetData['name']
|
||||||
property string subTitle: getSubtitle()
|
property string subTitle: getSubtitle()
|
||||||
property bool titleIsPageTitle: true
|
property bool titleIsPageTitle: true
|
||||||
|
|
||||||
property Component headerComponent: Item {
|
property Component headerComponent: Item {
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
|
height: parent.height
|
||||||
|
width: moreToolBt.width * 1.5
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: cupToolBt
|
id: moreToolBt
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
right: parent.right
|
right: parent.right
|
||||||
rightMargin: parent.width * 0.1
|
rightMargin: parent.width * 0.5
|
||||||
}
|
}
|
||||||
|
|
||||||
height: parent.height * 0.5
|
height: parent.height * 0.5
|
||||||
|
@ -48,8 +51,8 @@ DataListView {
|
||||||
control.changeCat()
|
control.changeCat()
|
||||||
}
|
}
|
||||||
|
|
||||||
onPressed: cupToolBt.scale = 0.9
|
onPressed: moreToolBt.scale = 0.9
|
||||||
onReleased: cupToolBt.scale = 1.0
|
onReleased: moreToolBt.scale = 1.0
|
||||||
|
|
||||||
background: Image {
|
background: Image {
|
||||||
|
|
||||||
|
@ -70,15 +73,16 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
property var widgetData: ({})
|
property var widgetData: currentWidgetData
|
||||||
|
|
||||||
function getSubtitle() {
|
function getSubtitle() {
|
||||||
var titleString
|
var titleString
|
||||||
|
|
||||||
|
if(control.widgetData["categorys"] === undefined)
|
||||||
|
return ""
|
||||||
|
|
||||||
for(var i = 0; i < control.widgetData["categorys"].length; i ++ ){
|
for(var i = 0; i < control.widgetData["categorys"].length; i ++ ){
|
||||||
//console.log("checking " + i + ": cat: " + parseInt(control.widgetData["categorys"][i]["GrpId"]) + " searched cat: " + params.cat)
|
//console.log("checking " + i + ": cat: " + parseInt(control.widgetData["categorys"][i]["GrpId"]) + " searched cat: " + params.cat)
|
||||||
if(parseInt(control.widgetData["categorys"][i]["GrpId"]) === parseInt(params.cat)){
|
if(parseInt(control.widgetData["categorys"][i]["GrpId"]) === parseInt(params.cat)){
|
||||||
|
@ -86,9 +90,14 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var addition = "(Registration) "
|
var addition = "(Registration) "
|
||||||
|
|
||||||
|
if(titleString !== undefined){
|
||||||
return addition + titleString
|
return addition + titleString
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,8 +152,21 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status: model === 0 ? 901:200
|
||||||
|
|
||||||
model: widgetData[ 'athletes' ] === undefined ? 0:widgetData[ 'athletes' ].length
|
model: widgetData[ 'athletes' ] === undefined ? 0:widgetData[ 'athletes' ].length
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if(model > 0){
|
||||||
|
control.ready = true
|
||||||
|
control.status = 200
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
control.ready = false
|
||||||
|
control.status = 901
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onRefresh: {
|
onRefresh: {
|
||||||
updateData({}, false)
|
updateData({}, false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,21 +25,24 @@ import "../Components"
|
||||||
DataListView {
|
DataListView {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
|
property bool ready
|
||||||
|
|
||||||
property string title: control.widgetData['comp_name']
|
property string title: control.widgetData['comp_name']
|
||||||
property string subTitle: getSubtitle()
|
property string subTitle: getSubtitle()
|
||||||
property bool titleIsPageTitle: true
|
property bool titleIsPageTitle: true
|
||||||
|
|
||||||
property Component headerComponent: Item {
|
property Component headerComponent: Item {
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
|
height: parent.height
|
||||||
|
width: moreToolBt.width * 1.5
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: cupToolBt
|
id: moreToolBt
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
right: parent.right
|
right: parent.right
|
||||||
rightMargin: parent.width * 0.1
|
rightMargin: parent.width * 0.5
|
||||||
}
|
}
|
||||||
|
|
||||||
height: parent.height * 0.5
|
height: parent.height * 0.5
|
||||||
|
@ -49,8 +52,8 @@ DataListView {
|
||||||
control.changeCat()
|
control.changeCat()
|
||||||
}
|
}
|
||||||
|
|
||||||
onPressed: cupToolBt.scale = 0.9
|
onPressed: moreToolBt.scale = 0.9
|
||||||
onReleased: cupToolBt.scale = 1.0
|
onReleased: moreToolBt.scale = 1.0
|
||||||
|
|
||||||
background: Image {
|
background: Image {
|
||||||
|
|
||||||
|
@ -71,14 +74,25 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
property var widgetData: ({})
|
property var widgetData: currentWidgetData
|
||||||
|
|
||||||
onWidgetDataChanged: {
|
Component.onCompleted: {
|
||||||
model = widgetData[ "participants" ] === undefined ? 0:widgetData[ "participants" ].length
|
if(model > 0){
|
||||||
|
control.ready = true
|
||||||
|
control.status = 200
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
control.ready = false
|
||||||
|
control.status = 901
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!control.ready)
|
||||||
|
return
|
||||||
|
|
||||||
|
//model = widgetData[ "participants" ] === undefined ? 0:widgetData[ "participants" ].length
|
||||||
|
//routeSelectTb.setCurrentIndex(routeSelectTb.getIndex(parseInt(control.widgetData['route_order'])))
|
||||||
}
|
}
|
||||||
|
|
||||||
model: widgetData[ "participants" ] === undefined ? 0:widgetData[ "participants" ].length
|
model: widgetData[ "participants" ] === undefined ? 0:widgetData[ "participants" ].length
|
||||||
|
@ -98,7 +112,14 @@ DataListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
var addition = qsTr("(Results)")
|
var addition = qsTr("(Results)")
|
||||||
return addition + " " + titleString
|
|
||||||
|
if(titleString !== undefined){
|
||||||
|
return addition + titleString
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +150,7 @@ DataListView {
|
||||||
target: selector
|
target: selector
|
||||||
onSelectionFinished: {
|
onSelectionFinished: {
|
||||||
if(data.cat !== undefined){
|
if(data.cat !== undefined){
|
||||||
updateData({cat: data.cat}, true)
|
updateData({cat: data.cat, route:""}, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +183,6 @@ DataListView {
|
||||||
NumberAnimation { target: partDel; property: "scale"; from: 0.8; to: 1.0; duration: 400 }
|
NumberAnimation { target: partDel; property: "scale"; from: 0.8; to: 1.0; duration: 400 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
@ -195,7 +215,7 @@ DataListView {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
||||||
text: widgetData[ "participants" ][index]["result_rank"] === undefined ? "":widgetData[ "participants" ][index]["result_rank"]
|
text: partDel.thisData["result_rank"] === undefined ? "":partDel.thisData["result_rank"]
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
@ -208,7 +228,7 @@ DataListView {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
|
||||||
text: widgetData[ "participants" ][index]["firstname"] + " " + widgetData[ "participants" ][index]["lastname"]
|
text: partDel.thisData["firstname"] + " " + partDel.thisData["lastname"]
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
@ -225,7 +245,7 @@ DataListView {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
||||||
text: "<html>(<a href=\"" + (widgetData[ "participants" ][index]["fed_url"] === undefined ? "":widgetData[ "participants" ][index]["fed_url"]).toString() + "\">" + (widgetData[ "display_athlete" ] === "nation" ? widgetData[ "participants" ][index]["nation"] : widgetData[ "participants" ][index]["federation"]) + "</a>)</html>"
|
text: "<html>(<a href=\"" + (partDel.thisData["fed_url"] === undefined ? "":partDel.thisData["fed_url"]).toString() + "\">" + (widgetData[ "display_athlete" ] === "nation" ? partDel.thisData["nation"] : partDel.thisData["federation"]) + "</a>)</html>"
|
||||||
|
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
Qt.openUrlExternally(link)
|
Qt.openUrlExternally(link)
|
||||||
|
@ -491,7 +511,7 @@ DataListView {
|
||||||
width: parent.width / ( generalResRep.model )
|
width: parent.width / ( generalResRep.model )
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
|
||||||
visible: boulderGenResLa.text != ""
|
visible: enabled
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
|
@ -560,6 +580,10 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer: ItemDelegate {
|
||||||
|
height: routeSelectTb.height
|
||||||
|
}
|
||||||
|
|
||||||
RectangularGlow {
|
RectangularGlow {
|
||||||
id: toolBarEffect
|
id: toolBarEffect
|
||||||
glowRadius: 3
|
glowRadius: 3
|
||||||
|
@ -581,13 +605,17 @@ DataListView {
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
height: tabs.length > 0 ? 50:0
|
height: tabs.length > 1 ? 50:0
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
position: TabBar.Footer
|
position: TabBar.Footer
|
||||||
|
|
||||||
|
currentIndex: getIndex(parseInt(control.widgetData['route_order']))
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
//currentIndex = getIndex(params.route)
|
//currentIndex = getIndex(params.route)
|
||||||
setCurrentIndex(getIndex(props.route))
|
//setCurrentIndex(getIndex(params.route))
|
||||||
|
//routeSelectTb.setCurrentIndex(routeSelectTb.getIndex(parseInt(control.widgetData['route_order'])))
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTabs() {
|
function getTabs() {
|
||||||
|
@ -599,7 +627,7 @@ DataListView {
|
||||||
// go through the whole array and search for data keys
|
// go through the whole array and search for data keys
|
||||||
if (obj.hasOwnProperty(prop)) {
|
if (obj.hasOwnProperty(prop)) {
|
||||||
buttonData.push([prop, obj[prop]])
|
buttonData.push([prop, obj[prop]])
|
||||||
console.log("found " + obj[prop] + " at index " + prop)
|
//console.log("found " + obj[prop] + " at index " + prop)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,12 +639,16 @@ DataListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIndex(routeNumber) {
|
function getIndex(routeNumber) {
|
||||||
console.log("getting index for route number: " + routeNumber)
|
//console.log("getting index for route number: " + routeNumber)
|
||||||
|
|
||||||
|
if(tabs === undefined){
|
||||||
|
//return
|
||||||
|
}
|
||||||
|
|
||||||
for(var i = 0; i < tabs.length; i++){
|
for(var i = 0; i < tabs.length; i++){
|
||||||
//console.log(tabs[i])
|
//console.log(tabs[i])
|
||||||
if(parseInt(tabs[i][0]) === routeNumber){
|
if(parseInt(tabs[i][0]) === routeNumber){
|
||||||
console.log("found index: " + i)
|
//console.log("found index: " + i)
|
||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -641,12 +673,13 @@ DataListView {
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
//console.log("changing to index: " + index + " (" + routeSelectTb.tabs[index][0] + ", " + routeSelectTb.tabs[index][1] + ")")
|
//console.log("changing to index: " + index + " (" + routeSelectTb.tabs[index][0] + ", " + routeSelectTb.tabs[index][1] + ")")
|
||||||
|
if(routeSelectTb.getIndex(parseInt(control.widgetData['route_order'])) !== index){
|
||||||
control.changeRoute(routeSelectTb.tabs[index][0])
|
control.changeRoute(routeSelectTb.tabs[index][0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,27 +18,31 @@
|
||||||
|
|
||||||
import QtQuick 2.9
|
import QtQuick 2.9
|
||||||
import QtQuick.Controls 2.4
|
import QtQuick.Controls 2.4
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
import "../Components"
|
import "../Components"
|
||||||
|
|
||||||
DataListView {
|
DataListView {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
|
property bool ready
|
||||||
|
|
||||||
property string title: control.widgetData['comp_name']
|
property string title: control.widgetData['comp_name']
|
||||||
property string subTitle: getSubtitle()
|
property string subTitle: qsTr("(Startlist)") + " " + control.widgetData['route_name'] //getSubtitle()
|
||||||
property bool titleIsPageTitle: true
|
property bool titleIsPageTitle: true
|
||||||
|
|
||||||
property Component headerComponent: Item {
|
property Component headerComponent: Item {
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
|
height: parent.height
|
||||||
|
width: moreToolBt.width * 1.5
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: cupToolBt
|
id: moreToolBt
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
right: parent.right
|
right: parent.right
|
||||||
rightMargin: parent.width * 0.1
|
rightMargin: parent.width * 0.5
|
||||||
}
|
}
|
||||||
|
|
||||||
height: parent.height * 0.5
|
height: parent.height * 0.5
|
||||||
|
@ -48,8 +52,8 @@ DataListView {
|
||||||
control.changeCat()
|
control.changeCat()
|
||||||
}
|
}
|
||||||
|
|
||||||
onPressed: cupToolBt.scale = 0.9
|
onPressed: moreToolBt.scale = 0.9
|
||||||
onReleased: cupToolBt.scale = 1.0
|
onReleased: moreToolBt.scale = 1.0
|
||||||
|
|
||||||
background: Image {
|
background: Image {
|
||||||
|
|
||||||
|
@ -70,8 +74,6 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSubtitle() {
|
function getSubtitle() {
|
||||||
|
@ -89,6 +91,9 @@ DataListView {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeRoute(route) {
|
||||||
|
updateData({route:route}, true)
|
||||||
|
}
|
||||||
|
|
||||||
function changeCat(){
|
function changeCat(){
|
||||||
var cats = control.widgetData["categorys"]
|
var cats = control.widgetData["categorys"]
|
||||||
|
@ -118,11 +123,23 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property var widgetData: currentWidgetData
|
||||||
property var widgetData: ({})
|
|
||||||
|
|
||||||
model: widgetData[ "participants" ] === undefined ? 0:widgetData[ "participants" ].length
|
model: widgetData[ "participants" ] === undefined ? 0:widgetData[ "participants" ].length
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if(model > 0){
|
||||||
|
control.ready = true
|
||||||
|
control.status = 200
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
control.ready = false
|
||||||
|
control.status = 901
|
||||||
|
}
|
||||||
|
|
||||||
|
routeSelectTb.setCurrentIndex(routeSelectTb.getIndex(parseInt(control.widgetData['route_order'])))
|
||||||
|
}
|
||||||
|
|
||||||
onRefresh: {
|
onRefresh: {
|
||||||
updateData({}, false)
|
updateData({}, false)
|
||||||
}
|
}
|
||||||
|
@ -209,4 +226,94 @@ DataListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer: ItemDelegate {
|
||||||
|
height: routeSelectTb.height
|
||||||
|
}
|
||||||
|
|
||||||
|
RectangularGlow {
|
||||||
|
id: toolBarEffect
|
||||||
|
glowRadius: 3
|
||||||
|
spread: 0.2
|
||||||
|
color: "black"
|
||||||
|
opacity: 0.3
|
||||||
|
anchors.fill: routeSelectTb
|
||||||
|
}
|
||||||
|
|
||||||
|
TabBar {
|
||||||
|
id: routeSelectTb
|
||||||
|
|
||||||
|
property var tabs: getTabs()
|
||||||
|
property var tabIndexes: []
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
|
||||||
|
height: tabs.length > 1 ? 50:0
|
||||||
|
|
||||||
|
position: TabBar.Footer
|
||||||
|
|
||||||
|
function getTabs() {
|
||||||
|
|
||||||
|
var obj = control.widgetData["route_names"]
|
||||||
|
var buttonData = []
|
||||||
|
|
||||||
|
for(var prop in obj) {
|
||||||
|
// go through the whole array and search for data keys
|
||||||
|
if (obj.hasOwnProperty(prop)) {
|
||||||
|
buttonData.push([prop, obj[prop]])
|
||||||
|
console.log("found " + obj[prop] + " at index " + prop)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buttonData.sort(function(a, b) {
|
||||||
|
return a[0] - b[0];
|
||||||
|
});
|
||||||
|
|
||||||
|
return buttonData
|
||||||
|
}
|
||||||
|
|
||||||
|
function getIndex(routeNumber) {
|
||||||
|
console.log("getting index for route number: " + routeNumber)
|
||||||
|
|
||||||
|
for(var i = 0; i < tabs.length; i++){
|
||||||
|
//console.log(tabs[i])
|
||||||
|
if(parseInt(tabs[i][0]) === routeNumber){
|
||||||
|
console.log("found index: " + i)
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
id: routeSelectButtonRep
|
||||||
|
|
||||||
|
model: routeSelectTb.tabs.length
|
||||||
|
|
||||||
|
onModelChanged: {
|
||||||
|
routeSelectTb.setCurrentIndex(routeSelectTb.getIndex(parseInt(control.widgetData['route_order'])))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
delegate: TabButton {
|
||||||
|
text: routeSelectTb.tabs[index][1]
|
||||||
|
|
||||||
|
width: Math.max(150, routeSelectTb.width / routeSelectButtonRep.model) //text.length * font.pixelSize
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
//console.log("changing to index: " + index + " (" + routeSelectTb.tabs[index][0] + ", " + routeSelectTb.tabs[index][1] + ")")
|
||||||
|
|
||||||
|
control.changeRoute(routeSelectTb.tabs[index][0])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,6 @@ Window {
|
||||||
//openWidget({nation:'GER'})
|
//openWidget({nation:'GER'})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Shortcut {
|
Shortcut {
|
||||||
sequences: ["Esc", "Back"]
|
sequences: ["Esc", "Back"]
|
||||||
enabled: mainStack.depth > 1
|
enabled: mainStack.depth > 1
|
||||||
|
@ -379,19 +378,31 @@ Window {
|
||||||
Loader {
|
Loader {
|
||||||
id: extraComponentLoader
|
id: extraComponentLoader
|
||||||
|
|
||||||
height: parent.height
|
property int maximumWidth: parent.width * 0.4 - toolButton.width - 3
|
||||||
width: status === Loader.Ready ? parent.width * 0.4 - toolButton.width - 3 * parent.spacing:0
|
|
||||||
|
|
||||||
|
height: parent.height
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onItemChanged: {
|
||||||
|
width = status === Loader.Ready ? item.width:0
|
||||||
|
}
|
||||||
|
|
||||||
//sourceComponent: mainStack.currentItem.headerComponent
|
//sourceComponent: mainStack.currentItem.headerComponent
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: mainStack
|
target: mainStack
|
||||||
onCurrentItemChanged: {
|
onCurrentItemChanged: {
|
||||||
|
secondCon.target = mainStack.currentItem
|
||||||
|
disappearNa.start()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
id: secondCon
|
||||||
|
onHeaderComponentChanged: {
|
||||||
disappearNa.start()
|
disappearNa.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -422,7 +433,6 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ParallelAnimation {
|
ParallelAnimation {
|
||||||
id: disappearNa
|
id: disappearNa
|
||||||
|
|
||||||
|
@ -522,6 +532,7 @@ Window {
|
||||||
|
|
||||||
var calComp = Qt.createComponent("qrc:/Pages/WidgetPage.qml").createObject(null, {"params": params})
|
var calComp = Qt.createComponent("qrc:/Pages/WidgetPage.qml").createObject(null, {"params": params})
|
||||||
app.errorCode = calComp.status
|
app.errorCode = calComp.status
|
||||||
|
|
||||||
if(calComp.ready){
|
if(calComp.ready){
|
||||||
mainStack.push(calComp)
|
mainStack.push(calComp)
|
||||||
}
|
}
|
||||||
|
@ -565,8 +576,8 @@ Window {
|
||||||
break
|
break
|
||||||
case 900:
|
case 900:
|
||||||
infoLevel = 2
|
infoLevel = 2
|
||||||
errorString = "Internal processing error"
|
errorString = "Internal error"
|
||||||
errorDescription = "The server has sent some data that could ot be processed. Please try again later"
|
errorDescription = "Something went wron internally, this is probaply an inssue in the program code"
|
||||||
break
|
break
|
||||||
case 901:
|
case 901:
|
||||||
infoLevel = 1
|
infoLevel = 1
|
||||||
|
|
BIN
resources/shared/favicon.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
resources/shared/favicon.png
Normal file
After Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 82 KiB |
BIN
resources/shared/photo_2019-05-29_14-01-43.jpg
Normal file
After Width: | Height: | Size: 35 KiB |