- 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
This commit is contained in:
Dorian Zedler 2019-02-16 22:38:13 +01:00
parent 1b26b1edda
commit 381d239d89
9 changed files with 261 additions and 197 deletions

View file

@ -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/) 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). 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 ### Geändert
- neue Vertretungsplan api implementiert - neue Vertretungsplan api implementiert
- neues Anmeldesystem des Vertretungsplanes 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 ## [0.9.x] - 2018-12-30
### Geändert ### Geändert

View file

@ -29,6 +29,7 @@ Page {
title: qsTr("Vertretungsplan") title: qsTr("Vertretungsplan")
property int status: -1 property int status: -1
property bool locked: root.status === -1
signal opened() signal opened()

View file

@ -27,6 +27,7 @@ Page {
id: root id: root
property bool teacherMode: _cppAppSettings.loadSetting("teacherMode") === "true" property bool teacherMode: _cppAppSettings.loadSetting("teacherMode") === "true"
property bool locked: false
title: "Vertretungsplan Filter" title: "Vertretungsplan Filter"

View file

@ -27,6 +27,7 @@ Page {
title: qsTr("Speiseplan") title: qsTr("Speiseplan")
property int status: -1 property int status: -1
property bool locked: root.status === -1
signal opened() signal opened()

View file

@ -24,6 +24,8 @@ import "../Components"
Page { Page {
id: root id: root
property bool locked: false
signal opened() signal opened()
onOpened: {} onOpened: {}

View file

@ -25,6 +25,7 @@ Page {
signal refresh() signal refresh()
property int status: -1 property int status: -1
property bool locked: false
BusyIndicator { BusyIndicator {
anchors.centerIn: parent anchors.centerIn: parent

View file

@ -27,6 +27,7 @@ Page {
title: "Einstellungen" title: "Einstellungen"
signal opened() signal opened()
property bool locked: false
onOpened: {} onOpened: {}

View file

@ -33,18 +33,35 @@ Page {
} }
} }
Grid {
id: mainGrid
columns: app.landscape() ? 2:1
rows: app.landscape() ? 1:2
spacing: 0
anchors.fill: parent
width: parent.width
height: parent.height
Column {
id: logoInfoCol
width: app.landscape() ? root.width * 0.5:root.width
height: app.landscape() ? root.height:root.height * 0.3
Image { Image {
id: bigLogo id: bigLogo
source: "qrc:/graphics/images/FannyIcon.png" source: "qrc:/graphics/images/FannyIcon.png"
anchors { anchors {
top: parent.top
left: parent.left left: parent.left
right: parent.right right: parent.right
margins: window.height * 0.01
} }
height: window.height * 0.2 height: parent.height * 0.6
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
mipmap: true mipmap: true
smooth: true smooth: true
@ -52,38 +69,41 @@ Page {
Label { Label {
id: infoText id: infoText
text: "<html>Bitte melde dich mit den Anmeldedaten der Fanny-Webseite an. anchors.horizontalCenter: parent.horizontalCenter
width: parent.width * 0.8
height: parent.height * 0.2
fontSizeMode: Text.Fit;
minimumPixelSize: 10;
font.pixelSize: 72
text: "<html>Bitte melde dich mit den Anmeldedaten der <a href='http://www.fanny-leicht.de/'>Fanny-Webseite</a> an.
<a href='http://www.fanny-leicht.de/j34/index.php/aktuelles/vertretungsplan'>Weitere Informationen</a></html>" <a href='http://www.fanny-leicht.de/j34/index.php/aktuelles/vertretungsplan'>Weitere Informationen</a></html>"
wrapMode: Text.Wrap wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
onLinkActivated: { onLinkActivated: {
Qt.openUrlExternally(link) Qt.openUrlExternally(link)
} }
anchors {
top: bigLogo.bottom
left: parent.left
right: parent.right
leftMargin: window.width * 0.05
rightMargin: window.width * 0.05
} }
} }
Column { Column {
spacing: ( height - 100 ) * 0.1 id: formCol
spacing: height * 0.01
anchors { width: app.landscape() ? root.width * 0.5:root.width
left: parent.left height: app.landscape() ? root.height:root.height * 0.7
right: parent.right
top: infoText.bottom property int rowHeight: height / 6 - spacing * 2 > 60 ? 60: height / 6 - spacing * 2
bottom: parent.bottom
topMargin: root.height * 0.02 Rectangle {
bottomMargin: root.height * 0.2 id: spacer
height: formCol.spacing
color: "transparent"
} }
TextField { TextField {
id: tiuname id: tiuname
placeholderText: "Benutzername"
Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked)
anchors { anchors {
left: parent.left left: parent.left
@ -91,6 +111,11 @@ Page {
right: parent.right right: parent.right
rightMargin: root.width * 0.05 rightMargin: root.width * 0.05
} }
height: formCol.rowHeight
placeholderText: "Benutzername"
Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked)
} }
@ -99,6 +124,8 @@ Page {
placeholderText: "Passwort" placeholderText: "Passwort"
Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked) Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked)
height: formCol.rowHeight
anchors { anchors {
left: parent.left left: parent.left
leftMargin: root.width * 0.05 leftMargin: root.width * 0.05
@ -200,6 +227,8 @@ Page {
text: qsTr("Angemeldet bleiben") text: qsTr("Angemeldet bleiben")
checked: true checked: true
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: formCol.rowHeight
} }
FancyButton { FancyButton {
@ -208,55 +237,39 @@ Page {
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
left: parent.left left: parent.left
margins: window.width * 0.05 margins: root.width * 0.05
} }
height: formCol.rowHeight
text: qsTr("Anmelden") text: qsTr("Anmelden")
enabled: tiuname.length > 0 & tipasswd.length > 0 enabled: tiuname.length > 0 & tipasswd.length > 0
onClicked: login(tiuname.text, tipasswd.text, cBperm.checked) onClicked: root.login(tiuname.text, tipasswd.text, cBperm.checked)
} }
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 { Label {
id: laStatus id: laStatus
text: qsTr("") text: qsTr("")
font.pixelSize: 20 font.pixelSize: height * 0.3
color: "red" color: "red"
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} height: formCol.rowHeight
}
function login(username, password, permanent){
// hide the keyboard
Qt.inputMethod.hide();
// open the busy dialog
busyDialog.open()
// disable the login button
loginButton.enabled = false
// 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);
// the request has finished
// close the busy dialog
busyDialog.close()
// enable the button
loginButton.enabled = true
// change the text of the login button back to "Anmelden"
loginButton.text = "Anmelden"
// chekc if the login was successfull
if(ret === 200){
// if it was -> set the app to inited and set the state of the app to loggedIn
_cppAppSettings.writeSetting("init", 1);
app.is_error = false;
app.state = "loggedIn"
}
else{
// if it wasn't -> set the error label to the error short description of the retuned error code
laStatus.text = app.getErrorInfo(ret)[1]
} }
} }
@ -293,3 +306,39 @@ Page {
} }
} }
} }
function login(username, password, permanent){
// hide the keyboard
Qt.inputMethod.hide();
// open the busy dialog
busyDialog.open()
// disable the login button
loginButton.enabled = false
// change the text to "Anmelden.."
loginButton.text = "Anmelden.."
// trigger the login fucntion of the cpp backend and store the return code
var ret = serverConn.login(username, password, permanent);
// the request has finished
// close the busy dialog
busyDialog.close()
// enable the button
loginButton.enabled = true
// change the text of the login button back to "Anmelden"
loginButton.text = "Anmelden"
// chekc if the login was successfull
if(ret === 200){
// if it was -> set the app to inited and set the state of the app to loggedIn
_cppAppSettings.writeSetting("init", 1);
app.is_error = false;
app.state = "loggedIn"
}
else{
// if it wasn't -> set the error label to the error short description of the retuned error code
laStatus.text = app.getErrorInfo(ret)[1]
}
}
}

View file

@ -31,9 +31,11 @@ Page {
sequences: ["Esc", "Back"] sequences: ["Esc", "Back"]
enabled: formStack.depth > 1 enabled: formStack.depth > 1
onActivated: { onActivated: {
if(!formStack.currentItem.locked){
formStack.pop() formStack.pop()
} }
} }
}
StackView { StackView {
id: formStack id: formStack
@ -145,10 +147,8 @@ Page {
width: height width: height
onClicked: { onClicked: {
if (formStack.depth > 1) { if(!formStack.currentItem.locked){
formStack.pop() formStack.pop()
} else {
drawer.open()
} }
} }