See 0.03.2 for Details

This commit is contained in:
dorian 2018-06-30 20:59:42 +02:00
parent 623daacc10
commit 46d2625fd0
10 changed files with 202 additions and 103 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<manifest package="com.itsblue.flgvertretungtest" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.03.2" android:versionCode="5" android:installLocation="auto"> <manifest package="com.itsblue.flgvertretung" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.03.2" android:versionCode="5" android:installLocation="auto">
<paths xmlns:android="http://schemas.android.com/apk/res/android"> <paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/> <external-path name="external_files" path="."/>
</paths> </paths>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.6.2, 2018-06-29T23:43:34. --> <!-- Written by QtCreator 4.6.2, 2018-06-30T20:49:46. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
@ -8,7 +8,7 @@
</data> </data>
<data> <data>
<variable>ProjectExplorer.Project.ActiveTarget</variable> <variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">1</value> <value type="int">0</value>
</data> </data>
<data> <data>
<variable>ProjectExplorer.Project.EditorSettings</variable> <variable>ProjectExplorer.Project.EditorSettings</variable>
@ -59,14 +59,14 @@
<data> <data>
<variable>ProjectExplorer.Project.Target.0</variable> <variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Android for armeabi-v7a (GCC 4.9, Qt 5.11.1 for Android armv7)</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Android for armeabi-v7a (GCC 4.9, Qt 5.10.1 for Android armv72)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Android for armeabi-v7a (GCC 4.9, Qt 5.11.1 for Android armv7)</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Android for armeabi-v7a (GCC 4.9, Qt 5.10.1 for Android armv72)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{90080436-d11a-44c6-8604-3a0027d99b29}</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{0560b570-8c4b-4d85-a4a2-e3653c24ac2c}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_11_1_for_Android_armv7-Debug</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_10_1_for_Android_armv72-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -100,7 +100,7 @@
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.3"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.3">
<value type="QString" key="BuildTargetSdk">android-27</value> <value type="QString" key="BuildTargetSdk">android-27</value>
<value type="QString" key="KeystoreLocation"></value> <value type="QString" key="KeystoreLocation">/home/dorian/Documents/gitlab/fanny-app/android_release.keystore</value>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build Android APK</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build Android APK</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
@ -142,7 +142,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_11_1_for_Android_armv7-Release</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/builds/Qt/fanny-app/build-fannyapp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_10_1_for_Android_armv72-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -153,7 +153,7 @@
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -218,7 +218,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_11_1_for_Android_armv7-Profile</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_10_1_for_Android_armv72-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -229,7 +229,7 @@
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -378,14 +378,14 @@
<data> <data>
<variable>ProjectExplorer.Project.Target.1</variable> <variable>ProjectExplorer.Project.Target.1</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.11.1 GCC 64bit</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.10.1 GCC 64bit2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.11.1 GCC 64bit</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.10.1 GCC 64bit2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5111.gcc_64_kit</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5101.gcc_64_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Desktop_Qt_5_11_1_GCC_64bit-Debug</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Desktop_Qt_5_10_1_GCC_64bit2-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -445,7 +445,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Desktop_Qt_5_11_1_GCC_64bit-Release</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Desktop_Qt_5_10_1_GCC_64bit2-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -456,7 +456,7 @@
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -505,7 +505,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Desktop_Qt_5_11_1_GCC_64bit-Profile</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dorian/Documents/gitlab/build-fannyapp-Desktop_Qt_5_10_1_GCC_64bit2-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -516,7 +516,7 @@
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -629,7 +629,7 @@
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fannyapp.pro</value> <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fannyapp.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">/home/dorian/Documents/gitlab/build-fannyapp-Desktop_Qt_5_11_1_GCC_64bit-Debug</value> <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">/home/dorian/Documents/builds/Qt/fanny-app/build-fannyapp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_10_1_for_Android_armv72-Release</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>

View file

@ -42,7 +42,7 @@ public:
signals: signals:
public slots: public slots:
void updateProgress(qint64 read, qint64 total); Q_INVOKABLE void updateProgress(qint64 read, qint64 total);
private: private:

View file

@ -76,7 +76,7 @@ Page {
text: _cppServerConn.getFoodPlanData(index).cookteam text: _cppServerConn.getFoodPlanData(index).cookteam
width: parent.width - 10 width: parent.width - 10
wrapMode: Label.Wrap wrapMode: Label.Wrap
height: text!=""? none:0 height: text!=""? undefined:0
} }
Label { Label {
anchors.left: parent.left anchors.left: parent.left
@ -109,7 +109,7 @@ Page {
wrapMode: Label.Wrap wrapMode: Label.Wrap
id: main_dish id: main_dish
text: _cppServerConn.getFoodPlanData(index).main_dish text: _cppServerConn.getFoodPlanData(index).main_dish
height: text!=""? none:0 height: text!=""? undefined:0
} }
Rectangle { Rectangle {
@ -132,7 +132,7 @@ Page {
text: _cppServerConn.getFoodPlanData(index).main_dish_veg text: _cppServerConn.getFoodPlanData(index).main_dish_veg
width: parent.width - 10 width: parent.width - 10
wrapMode: Label.Wrap wrapMode: Label.Wrap
height: text!=""? none:0 height: text!=""? undefined:0
} }
Rectangle { Rectangle {
@ -154,7 +154,7 @@ Page {
text: _cppServerConn.getFoodPlanData(index).garnish text: _cppServerConn.getFoodPlanData(index).garnish
width: parent.width - 10 width: parent.width - 10
wrapMode: Label.Wrap wrapMode: Label.Wrap
height: text!=""? none:0 height: text!=""? undefined:0
} }
Rectangle { Rectangle {
@ -177,7 +177,7 @@ Page {
text: _cppServerConn.getFoodPlanData(index).dessert text: _cppServerConn.getFoodPlanData(index).dessert
width: parent.width - 10 width: parent.width - 10
wrapMode: Label.Wrap wrapMode: Label.Wrap
height: text!=""? none:0 height: text!=""? undefined:0
} }
Label { Label {

View file

@ -123,11 +123,12 @@ Page {
contentHeight: aboutColumn.height contentHeight: aboutColumn.height
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok | Dialog.Cancel
onAccepted: { onAccepted: {
_cppServerConn.updateProgress(0,100)
busyDialog.open() busyDialog.open()
text.visible = false text.visible = false
console.log("getting file of ", day)
var ret = _cppServerConn.getDay(day) var ret = _cppServerConn.getDay(day)
console.log(ret) progressCircle.arcEnd = 36000
progress.text = "100%"
busyDialog.close() busyDialog.close()
text.visible = true text.visible = true
if(ret === "OK"){ if(ret === "OK"){
@ -168,16 +169,23 @@ Page {
//width: Math.min(window.width, window.height) / 3 * 2 //width: Math.min(window.width, window.height) / 3 * 2
height: contentHeight * 1.5 height: contentHeight * 1.5
width: contentWidth * 1.5 width: contentWidth * 1.5
contentHeight: busyIndicator.height contentHeight: progressCircle.height
contentWidth: busyIndicator.width contentWidth: progressCircle.width
BusyIndicator {
id: busyIndicator ProgressCircle {
visible: true id: progressCircle
size: 50
lineWidth: 5
anchors.centerIn: parent anchors.centerIn: parent
colorCircle: "#FF3333"
colorBackground: "#E6E6E6"
showBackground: true
arcBegin: 0
arcEnd: 0
Label { Label {
id: progress id: progress
anchors.centerIn: parent anchors.centerIn: parent
text: _cppServerConn.getProgress() text: "0%"
} }
Timer { Timer {
id: refreshTimer id: refreshTimer
@ -186,17 +194,12 @@ Page {
repeat: true repeat: true
onTriggered: { onTriggered: {
var ret = _cppServerConn.getProgress() var ret = _cppServerConn.getProgress()
progressCircle.arcEnd = 360 * ret * 1.2
progress.text = Math.round( ret * 100 ) + "%" progress.text = Math.round( ret * 100 ) + "%"
progressBar.value = ret console.log(ret)
} }
} }
} }
ProgressBar {
id: progressBar
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: busyDialog.height / 1.5
}
} }
} }

View file

@ -127,16 +127,22 @@ Page {
//width: Math.min(window.width, window.height) / 3 * 2 //width: Math.min(window.width, window.height) / 3 * 2
height: contentHeight * 1.5 height: contentHeight * 1.5
width: contentWidth * 1.5 width: contentWidth * 1.5
contentHeight: busyIndicator.height contentHeight: progressCircle.height
contentWidth: busyIndicator.width contentWidth: progressCircle.width
BusyIndicator { ProgressCircle {
id: busyIndicator id: progressCircle
visible: true size: 50
lineWidth: 5
anchors.centerIn: parent anchors.centerIn: parent
colorCircle: "#FF3333"
colorBackground: "#E6E6E6"
showBackground: true
arcBegin: 0
arcEnd: 0
Label { Label {
id: progress id: progress
anchors.centerIn: parent anchors.centerIn: parent
text: _cppServerConn.getProgress() text: "0%"
} }
Timer { Timer {
id: refreshTimer id: refreshTimer
@ -145,17 +151,14 @@ Page {
repeat: true repeat: true
onTriggered: { onTriggered: {
var ret = _cppServerConn.getProgress() var ret = _cppServerConn.getProgress()
if(ret > 100 || ret < 0){
ret = 0
}
progress.text = Math.round( ret * 100 ) + "%" progress.text = Math.round( ret * 100 ) + "%"
progressBar.value = ret progressCircle.arcEnd = 360 * ret
} }
} }
} }
ProgressBar {
id: progressBar
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: busyDialog.height / 1.5
}
} }
} }

90
qml/ProgressCircle.qml Normal file
View file

@ -0,0 +1,90 @@
import QtQuick 2.0
import QtQml 2.2
Item {
id: root
width: size
height: size
property int size: 200 // The size of the circle in pixel
property real arcBegin: 0 // start arc angle in degree
property real arcEnd: 270 // end arc angle in degree
property real arcOffset: 0 // rotation
property bool isPie: false // paint a pie instead of an arc
property bool showBackground: false // a full circle as a background of the arc
property real lineWidth: 20 // width of the line
property string colorCircle: "#CC3333"
property string colorBackground: "#779933"
property alias beginAnimation: animationArcBegin.enabled
property alias endAnimation: animationArcEnd.enabled
property int animationDuration: 20
onArcBeginChanged: canvas.requestPaint()
onArcEndChanged: canvas.requestPaint()
Behavior on arcBegin {
id: animationArcBegin
enabled: true
NumberAnimation {
duration: root.animationDuration
easing.type: Easing.InOutCubic
}
}
Behavior on arcEnd {
id: animationArcEnd
enabled: true
NumberAnimation {
duration: root.animationDuration
easing.type: Easing.InOutCubic
}
}
Canvas {
id: canvas
anchors.fill: parent
rotation: -90 + parent.arcOffset
onPaint: {
var ctx = getContext("2d")
var x = width / 2
var y = height / 2
var start = Math.PI * (parent.arcBegin / 180)
var end = Math.PI * (parent.arcEnd / 180)
ctx.reset()
if (root.isPie) {
if (root.showBackground) {
ctx.beginPath()
ctx.fillStyle = root.colorBackground
ctx.moveTo(x, y)
ctx.arc(x, y, width / 2, 0, Math.PI * 2, false)
ctx.lineTo(x, y)
ctx.fill()
}
ctx.beginPath()
ctx.fillStyle = root.colorCircle
ctx.moveTo(x, y)
ctx.arc(x, y, width / 2, start, end, false)
ctx.lineTo(x, y)
ctx.fill()
} else {
if (root.showBackground) {
ctx.beginPath();
ctx.arc(x, y, (width / 2) - parent.lineWidth / 2, 0, Math.PI * 2, false)
ctx.lineWidth = root.lineWidth
ctx.strokeStyle = root.colorBackground
ctx.stroke()
}
ctx.beginPath();
ctx.arc(x, y, (width / 2) - parent.lineWidth / 2, start, end, false)
ctx.lineWidth = root.lineWidth
ctx.strokeStyle = root.colorCircle
ctx.stroke()
}
}
}
}

View file

@ -13,6 +13,7 @@ Page {
objectName: "WebsitePage"; objectName: "WebsitePage";
title: qsTr("Fanny Webseite") title: qsTr("Fanny Webseite")
ProgressBar { ProgressBar {
id: progress id: progress
width: parent.width width: parent.width
@ -25,15 +26,9 @@ Page {
value: webView.loadProgress == 100 ? 0 : webView.loadProgress / 100 value: webView.loadProgress == 100 ? 0 : webView.loadProgress / 100
} }
Button {
z: 1
anchors.top: parent.top
text:"\u21BA"
onClicked: webView.reload()
}
WebView { WebView {
id: webView id: webView
onLoadProgressChanged: console.log(loadProgress)
anchors { anchors {
top: webView.loadProgress < 100 ? progress.bottom:parent.top top: webView.loadProgress < 100 ? progress.bottom:parent.top
bottom: parent.bottom bottom: parent.bottom
@ -46,7 +41,18 @@ Page {
if (loadRequest.errorString) if (loadRequest.errorString)
console.error(loadRequest.errorString); console.error(loadRequest.errorString);
} }
// RoundButton {
// //z: -1
// anchors {
// bottom: parent.bottom
// bottomMargin: 10
// right: parent.right
// rightMargin: 10
// }
// text:"\u21BA"
// onClicked: webView.reload()
// }
} }
} }

View file

@ -8,5 +8,6 @@
<file>AppToolBar.qml</file> <file>AppToolBar.qml</file>
<file>WebsitePage.qml</file> <file>WebsitePage.qml</file>
<file>FoodPlanForm.qml</file> <file>FoodPlanForm.qml</file>
<file>ProgressCircle.qml</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -82,7 +82,7 @@ int ServerConn::logout()
QString ServerConn::getDay(QString day) QString ServerConn::getDay(QString day)
{ {
qDebug("getting file of day"); this->progress = 0;
// Create request // Create request
QNetworkRequest request; QNetworkRequest request;
request.setUrl( QUrl( "http://www.fanny-leicht.de/static15/http.intern/" + day + ".pdf" ) ); request.setUrl( QUrl( "http://www.fanny-leicht.de/static15/http.intern/" + day + ".pdf" ) );
@ -101,14 +101,13 @@ QString ServerConn::getDay(QString day)
connect(reply, SIGNAL(downloadProgress(qint64, qint64)), connect(reply, SIGNAL(downloadProgress(qint64, qint64)),
this, SLOT(updateProgress(qint64, qint64))); this, SLOT(updateProgress(qint64, qint64)));
this->progress = 0;
QEventLoop loop; QEventLoop loop;
loop.connect(this->networkManager, SIGNAL(finished(QNetworkReply*)), SLOT(quit())); loop.connect(this->networkManager, SIGNAL(finished(QNetworkReply*)), SLOT(quit()));
loop.exec(); loop.exec();
this->progress = 1;
int status_code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); int status_code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if(status_code == 200){ if(status_code == 200){
qDebug("OK");
QString path = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation); QString path = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
QDir dir; QDir dir;
@ -119,12 +118,9 @@ QString ServerConn::getDay(QString day)
file.open(QIODevice::ReadWrite); file.open(QIODevice::ReadWrite);
file.write(reply->readAll()); file.write(reply->readAll());
file.close(); file.close();
qDebug("opening PDF...");
this->progress = 1;
QDesktopServices::openUrl(QUrl::fromLocalFile(path + "/.fannyapp-tmp/" + day + ".pdf")); QDesktopServices::openUrl(QUrl::fromLocalFile(path + "/.fannyapp-tmp/" + day + ".pdf"));
qDebug() << QString::fromUtf8(reply->readAll()); qDebug("open");
qDebug() << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
return("OK"); return("OK");
} }
else if(status_code == 401){ else if(status_code == 401){