From 381d239d896c3f8588f6ead971a1a309f4242d7e Mon Sep 17 00:00:00 2001 From: dorian Date: Sat, 16 Feb 2019 22:38:13 +0100 Subject: [PATCH] - new design on login page (especially landscape mode) - fixed crash that occurred when switching pages too fast (events and foodplan form) - release 1.0.0 --- CHANGELOG.md | 10 +- qml/Forms/EventForm.qml | 1 + qml/Forms/FilterForm.qml | 1 + qml/Forms/FoodPlanForm.qml | 1 + qml/Forms/HomeForm.qml | 2 + qml/Forms/LoadingForm.qml | 1 + qml/Forms/SettingsForm.qml | 1 + qml/Pages/LoginPage.qml | 433 +++++++++++++++++++++---------------- qml/Pages/MainPage.qml | 8 +- 9 files changed, 261 insertions(+), 197 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0556d78..5686b5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## unreleased +## [1.0.0] +### Behoben +- Absturz, der bei schnellem wechsel zwischen Seiten (Vertretungsplan, Essensplan) auftrat + ### Geändert - neue Vertretungsplan api implementiert - neues Anmeldesystem des Vertretungsplanes implementiert +- neue Essensplan api implementiert +- Anmeldebidschirm neu gestaltet (vorallem im Querformat) + +### Hinzugefügt +- "Registriern" Taste auf dem Anmeldebidschirm ## [0.9.x] - 2018-12-30 ### Geändert diff --git a/qml/Forms/EventForm.qml b/qml/Forms/EventForm.qml index 7aa63e1..7efd109 100644 --- a/qml/Forms/EventForm.qml +++ b/qml/Forms/EventForm.qml @@ -29,6 +29,7 @@ Page { title: qsTr("Vertretungsplan") property int status: -1 + property bool locked: root.status === -1 signal opened() diff --git a/qml/Forms/FilterForm.qml b/qml/Forms/FilterForm.qml index 6989a43..4226baa 100644 --- a/qml/Forms/FilterForm.qml +++ b/qml/Forms/FilterForm.qml @@ -27,6 +27,7 @@ Page { id: root property bool teacherMode: _cppAppSettings.loadSetting("teacherMode") === "true" + property bool locked: false title: "Vertretungsplan Filter" diff --git a/qml/Forms/FoodPlanForm.qml b/qml/Forms/FoodPlanForm.qml index 17e6562..fe03990 100644 --- a/qml/Forms/FoodPlanForm.qml +++ b/qml/Forms/FoodPlanForm.qml @@ -27,6 +27,7 @@ Page { title: qsTr("Speiseplan") property int status: -1 + property bool locked: root.status === -1 signal opened() diff --git a/qml/Forms/HomeForm.qml b/qml/Forms/HomeForm.qml index d2a678f..ade04d8 100644 --- a/qml/Forms/HomeForm.qml +++ b/qml/Forms/HomeForm.qml @@ -24,6 +24,8 @@ import "../Components" Page { id: root + property bool locked: false + signal opened() onOpened: {} diff --git a/qml/Forms/LoadingForm.qml b/qml/Forms/LoadingForm.qml index c7d065e..6a68eec 100644 --- a/qml/Forms/LoadingForm.qml +++ b/qml/Forms/LoadingForm.qml @@ -25,6 +25,7 @@ Page { signal refresh() property int status: -1 + property bool locked: false BusyIndicator { anchors.centerIn: parent diff --git a/qml/Forms/SettingsForm.qml b/qml/Forms/SettingsForm.qml index 6403be6..e467771 100644 --- a/qml/Forms/SettingsForm.qml +++ b/qml/Forms/SettingsForm.qml @@ -27,6 +27,7 @@ Page { title: "Einstellungen" signal opened() + property bool locked: false onOpened: {} diff --git a/qml/Pages/LoginPage.qml b/qml/Pages/LoginPage.qml index 78a3d2a..be1cae9 100644 --- a/qml/Pages/LoginPage.qml +++ b/qml/Pages/LoginPage.qml @@ -33,194 +33,277 @@ Page { } } - Image { - id: bigLogo - source: "qrc:/graphics/images/FannyIcon.png" + Grid { + id: mainGrid + columns: app.landscape() ? 2:1 + rows: app.landscape() ? 1:2 + spacing: 0 - anchors { - top: parent.top - left: parent.left - right: parent.right - margins: window.height * 0.01 - } + anchors.fill: parent - height: window.height * 0.2 - fillMode: Image.PreserveAspectFit - mipmap: true - smooth: true - } + width: parent.width + height: parent.height - Label { - id: infoText - text: "Bitte melde dich mit den Anmeldedaten der Fanny-Webseite an. - Weitere Informationen" - wrapMode: Text.Wrap - onLinkActivated: { - Qt.openUrlExternally(link) - } + Column { + id: logoInfoCol - anchors { - top: bigLogo.bottom - left: parent.left - right: parent.right - leftMargin: window.width * 0.05 - rightMargin: window.width * 0.05 - } - } + width: app.landscape() ? root.width * 0.5:root.width + height: app.landscape() ? root.height:root.height * 0.3 - Column { - spacing: ( height - 100 ) * 0.1 + Image { + id: bigLogo + source: "qrc:/graphics/images/FannyIcon.png" - anchors { - left: parent.left - right: parent.right - top: infoText.bottom - bottom: parent.bottom - topMargin: root.height * 0.02 - bottomMargin: root.height * 0.2 - } - - TextField { - id: tiuname - placeholderText: "Benutzername" - Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked) - - anchors { - left: parent.left - leftMargin: root.width * 0.05 - right: parent.right - rightMargin: root.width * 0.05 - } - } - - - TextField { - id: tipasswd - placeholderText: "Passwort" - Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked) - - anchors { - left: parent.left - leftMargin: root.width * 0.05 - right: parent.right - rightMargin: root.width * 0.05 - } - - MouseArea { - id: passwordHideShow anchors { - top: parent.top - bottom: parent.bottom + left: parent.left right: parent.right } - width: visibleIcon.width - onClicked: { - if(state === "visible"){ - state = "invisible" - } - else { - state = "visible" - } + height: parent.height * 0.6 + + + fillMode: Image.PreserveAspectFit + mipmap: true + smooth: true + } + + Label { + id: infoText + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width * 0.8 + height: parent.height * 0.2 + fontSizeMode: Text.Fit; + minimumPixelSize: 10; + font.pixelSize: 72 + text: "Bitte melde dich mit den Anmeldedaten der Fanny-Webseite an. + Weitere Informationen" + wrapMode: Text.Wrap + horizontalAlignment: Text.AlignHCenter + onLinkActivated: { + Qt.openUrlExternally(link) } - state: "invisible" + } - states: [ - State { - name: "invisible" - PropertyChanges { - target: visibleIcon - scale: 0 - } - PropertyChanges { - target: invisibleIcon - scale: 1 - } - PropertyChanges { - target: tipasswd - echoMode: TextInput.Password - } - }, - State { - name: "visible" - PropertyChanges { - target: visibleIcon - scale: 1 - } - PropertyChanges { - target: invisibleIcon - scale: 0 - } - PropertyChanges { - target: tipasswd - echoMode: TextInput.Normal - } - } - ] + } - Image { - id: visibleIcon + Column { + id: formCol + spacing: height * 0.01 + width: app.landscape() ? root.width * 0.5:root.width + height: app.landscape() ? root.height:root.height * 0.7 + + property int rowHeight: height / 6 - spacing * 2 > 60 ? 60: height / 6 - spacing * 2 + + Rectangle { + id: spacer + height: formCol.spacing + color: "transparent" + } + + TextField { + id: tiuname + + anchors { + left: parent.left + leftMargin: root.width * 0.05 + right: parent.right + rightMargin: root.width * 0.05 + } + + height: formCol.rowHeight + + placeholderText: "Benutzername" + Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked) + } + + + TextField { + id: tipasswd + placeholderText: "Passwort" + Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked) + + height: formCol.rowHeight + + anchors { + left: parent.left + leftMargin: root.width * 0.05 + right: parent.right + rightMargin: root.width * 0.05 + } + + MouseArea { + id: passwordHideShow anchors { top: parent.top bottom: parent.bottom right: parent.right - - bottomMargin: parent.height * 0.25 - topMargin: anchors.bottomMargin } - fillMode: Image.PreserveAspectFit - smooth: true - mipmap: true - source: "qrc:/graphics/icons/view.png" + width: visibleIcon.width + + onClicked: { + if(state === "visible"){ + state = "invisible" + } + else { + state = "visible" + } + } + + state: "invisible" + + states: [ + State { + name: "invisible" + PropertyChanges { + target: visibleIcon + scale: 0 + } + PropertyChanges { + target: invisibleIcon + scale: 1 + } + PropertyChanges { + target: tipasswd + echoMode: TextInput.Password + } + }, + State { + name: "visible" + PropertyChanges { + target: visibleIcon + scale: 1 + } + PropertyChanges { + target: invisibleIcon + scale: 0 + } + PropertyChanges { + target: tipasswd + echoMode: TextInput.Normal + } + } + ] + + Image { + id: visibleIcon + + anchors { + top: parent.top + bottom: parent.bottom + right: parent.right + + bottomMargin: parent.height * 0.25 + topMargin: anchors.bottomMargin + } + fillMode: Image.PreserveAspectFit + smooth: true + mipmap: true + source: "qrc:/graphics/icons/view.png" + } + + Image { + id: invisibleIcon + + anchors { + top: parent.top + bottom: parent.bottom + right: parent.right + + bottomMargin: parent.height * 0.25 + topMargin: anchors.bottomMargin + } + fillMode: Image.PreserveAspectFit + smooth: true + mipmap: true + source: "qrc:/graphics/icons/hide.png" + } + } + } + + CheckDelegate { + id: cBperm + text: qsTr("Angemeldet bleiben") + checked: true + anchors.horizontalCenter: parent.horizontalCenter + + height: formCol.rowHeight + } + + FancyButton { + id: loginButton + + anchors { + horizontalCenter: parent.horizontalCenter + left: parent.left + margins: root.width * 0.05 } - Image { - id: invisibleIcon + height: formCol.rowHeight - anchors { - top: parent.top - bottom: parent.bottom - right: parent.right + text: qsTr("Anmelden") + enabled: tiuname.length > 0 & tipasswd.length > 0 + onClicked: root.login(tiuname.text, tipasswd.text, cBperm.checked) + } - bottomMargin: parent.height * 0.25 - topMargin: anchors.bottomMargin - } - fillMode: Image.PreserveAspectFit - smooth: true - mipmap: true - source: "qrc:/graphics/icons/hide.png" + FancyButton { + id: registerBt + + anchors { + horizontalCenter: parent.horizontalCenter + left: parent.left + margins: window.width * 0.05 } + + height: formCol.rowHeight + + text: qsTr("Registrieren") + enabled: true + onClicked: Qt.openUrlExternally("http://www.fanny-leicht.de/j34/index.php/login?view=registration") + } + + Label { + id: laStatus + text: qsTr("") + font.pixelSize: height * 0.3 + color: "red" + anchors.horizontalCenter: parent.horizontalCenter + height: formCol.rowHeight } } - CheckDelegate { - id: cBperm - text: qsTr("Angemeldet bleiben") - checked: true - anchors.horizontalCenter: parent.horizontalCenter - } + Dialog { + id: busyDialog + modal: true + closePolicy: "NoAutoClose" + focus: true + title: "Bitte warten..." + x: (app.width - width) / 2 + y: (app.height - height) / 2 + width: Math.min(window.width, window.height) / 3 * 2 + height: 150 + contentHeight: contentColumn.height + Column { + id: contentColumn + spacing: 20 + RowLayout { + width: parent.width + BusyIndicator { + id: busyIndicator + visible: true + x: 22 + y: 38 + } - FancyButton { - id: loginButton - - anchors { - horizontalCenter: parent.horizontalCenter - left: parent.left - margins: window.width * 0.05 + Label { + width: busyDialog.availableWidth + text: "Anmelden..." + wrapMode: Label.Wrap + font.pixelSize: 12 + } + } } - - text: qsTr("Anmelden") - enabled: tiuname.length > 0 & tipasswd.length > 0 - onClicked: login(tiuname.text, tipasswd.text, cBperm.checked) - } - Label { - id: laStatus - text: qsTr("") - font.pixelSize: 20 - color: "red" - anchors.horizontalCenter: parent.horizontalCenter } } @@ -234,8 +317,6 @@ Page { // change the text to "Anmelden.." loginButton.text = "Anmelden.." - console.log(username, password, permanent) - // trigger the login fucntion of the cpp backend and store the return code var ret = serverConn.login(username, password, permanent); @@ -260,36 +341,4 @@ Page { } } - Dialog { - id: busyDialog - modal: true - closePolicy: "NoAutoClose" - focus: true - title: "Bitte warten..." - x: (app.width - width) / 2 - y: (app.height - height) / 2 - width: Math.min(window.width, window.height) / 3 * 2 - height: 150 - contentHeight: contentColumn.height - Column { - id: contentColumn - spacing: 20 - RowLayout { - width: parent.width - BusyIndicator { - id: busyIndicator - visible: true - x: 22 - y: 38 - } - - Label { - width: busyDialog.availableWidth - text: "Anmelden..." - wrapMode: Label.Wrap - font.pixelSize: 12 - } - } - } - } } diff --git a/qml/Pages/MainPage.qml b/qml/Pages/MainPage.qml index 8be7210..61786d1 100644 --- a/qml/Pages/MainPage.qml +++ b/qml/Pages/MainPage.qml @@ -31,7 +31,9 @@ Page { sequences: ["Esc", "Back"] enabled: formStack.depth > 1 onActivated: { - formStack.pop() + if(!formStack.currentItem.locked){ + formStack.pop() + } } } @@ -145,10 +147,8 @@ Page { width: height onClicked: { - if (formStack.depth > 1) { + if(!formStack.currentItem.locked){ formStack.pop() - } else { - drawer.open() } }