From 638b5df2c5ddc47106fbd7e561590d12e2c8785c Mon Sep 17 00:00:00 2001 From: dorian Date: Fri, 6 Jul 2018 13:29:16 +0200 Subject: [PATCH] Fehlerbehebungen --- fannyapp.pro.user | 2 +- qml/FoodPlanForm.qml | 4 ++-- qml/HomeForm.qml | 2 +- qml/LoginPage.qml | 2 +- qml/MainPage.qml | 2 +- qml/WebsitePage.qml | 6 ++---- qml/main.qml | 31 ++++++++++++++++++------------- 7 files changed, 26 insertions(+), 23 deletions(-) diff --git a/fannyapp.pro.user b/fannyapp.pro.user index dbdd3b6..883a95b 100644 --- a/fannyapp.pro.user +++ b/fannyapp.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/qml/FoodPlanForm.qml b/qml/FoodPlanForm.qml index 2d1b2cb..03fbd33 100644 --- a/qml/FoodPlanForm.qml +++ b/qml/FoodPlanForm.qml @@ -4,7 +4,7 @@ import QtGraphicalEffects 1.0 Page { id:root - anchors.fill: parent + //anchors.fill: parent property bool cookplanChanged title: qsTr("Speiseplanplan") @@ -62,7 +62,7 @@ Page { width: listView.width id: delegate height: visible ? cookteam.height + date.height + main_dish.height + main_dish_veg.height + garnish.height + dessert.height + spacer.height + cust_spacing*9 + 5:0 - visible: index>6//listView.isDayVisible(index) + visible: listView.isDayVisible(index) property int cust_spacing: 5 diff --git a/qml/HomeForm.qml b/qml/HomeForm.qml index a7744da..e3a8fd3 100644 --- a/qml/HomeForm.qml +++ b/qml/HomeForm.qml @@ -3,7 +3,7 @@ import QtQuick.Controls 2.2 import QtGraphicalEffects 1.0 Page { - anchors.fill: parent + //anchors.fill: parent title: qsTr("Vertretungsplan") diff --git a/qml/LoginPage.qml b/qml/LoginPage.qml index 1dd7809..a9cc2b2 100644 --- a/qml/LoginPage.qml +++ b/qml/LoginPage.qml @@ -4,7 +4,7 @@ import QtQuick.Controls 2.2 Page { id: root - anchors.fill: parent + //anchors.fill: parent objectName: "LoginPage"; header: AppToolBar { diff --git a/qml/MainPage.qml b/qml/MainPage.qml index 3185ecb..a2c2a74 100644 --- a/qml/MainPage.qml +++ b/qml/MainPage.qml @@ -4,7 +4,7 @@ import QtQuick.Controls 2.2 Page { id: root objectName: "MainPage" - anchors.fill: parent + //anchors.fill: parent Shortcut { sequences: ["Esc", "Back"] diff --git a/qml/WebsitePage.qml b/qml/WebsitePage.qml index 1471efd..4522a63 100644 --- a/qml/WebsitePage.qml +++ b/qml/WebsitePage.qml @@ -8,7 +8,7 @@ import QtQuick.Controls.Styles 1.2 Page { id:root - anchors.fill: parent + //anchors.fill: parent objectName: "WebsitePage"; @@ -22,13 +22,11 @@ Page { } //z: Qt.platform.os === "android" ? -1 : 1 visible: webView.loadProgress < 100 - - value: webView.loadProgress == 100 ? 0 : webView.loadProgress / 100 + value: webView.loadProgress === 100 ? 0 : webView.loadProgress / 100 } WebView { id: webView - onLoadProgressChanged: console.log(loadProgress) anchors { top: webView.loadProgress < 100 ? progress.bottom:parent.top bottom: parent.bottom diff --git a/qml/main.qml b/qml/main.qml index 6e18fd8..7d13760 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -16,23 +16,23 @@ ApplicationWindow { property string background_color: "white" property string toolbar_color: "#312f38" - onBeforeRendering: { - if(!firstinitdone){ - var isinit = _cppAppSettings.loadSetting("init") - console.log("getinit"); - console.log(isinit); - if(isinit === "0"){ - stackView.push("qrc:/LoginPage.qml", {}); - } - } - firstinitdone = true - } +// onBeforeRendering: { +// if(!firstinitdone){ +// var isinit = _cppAppSettings.loadSetting("init") +// console.log("getinit"); +// console.log(isinit); +// if(isinit === "0"){ +// stackView.push("qrc:/LoginPage.qml", {}); +// } +// } +// firstinitdone = true +// } Timer { //runs only one time at applictaion lauch property bool finished: true id: initTimer - interval: 10; + interval: 1; running: initdone === false repeat: finished onTriggered: { @@ -45,6 +45,7 @@ ApplicationWindow { console.log("Perm") var ret = _cppServerConn.login(_cppAppSettings.loadSetting("username"), _cppAppSettings.loadSetting("password"), true); if(ret === "OK"){ + initdone = true _cppAppSettings.writeSetting("init", 1); if(stackView.currentItem.objectName !== "MainPage"){ stackView.push("qrc:/MainPage.qml", {}); @@ -64,7 +65,10 @@ ApplicationWindow { } } else { - stackView.push("qrc:/LoginPage.qml") + initdone = false + if(stackView.currentItem.objectName !== "LoginPage"){ + stackView.push("qrc:/LoginPage.qml") + } } finished = true initdone = true @@ -77,6 +81,7 @@ ApplicationWindow { running: initdone repeat: true onTriggered: { + console.log("refresh") var ret = _cppServerConn.checkConn() handleError(ret) }