- 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:
parent
1b26b1edda
commit
381d239d89
9 changed files with 261 additions and 197 deletions
10
CHANGELOG.md
10
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
|
||||
|
|
|
@ -29,6 +29,7 @@ Page {
|
|||
title: qsTr("Vertretungsplan")
|
||||
|
||||
property int status: -1
|
||||
property bool locked: root.status === -1
|
||||
|
||||
signal opened()
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ Page {
|
|||
id: root
|
||||
|
||||
property bool teacherMode: _cppAppSettings.loadSetting("teacherMode") === "true"
|
||||
property bool locked: false
|
||||
|
||||
title: "Vertretungsplan Filter"
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ Page {
|
|||
title: qsTr("Speiseplan")
|
||||
|
||||
property int status: -1
|
||||
property bool locked: root.status === -1
|
||||
|
||||
signal opened()
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@ import "../Components"
|
|||
Page {
|
||||
id: root
|
||||
|
||||
property bool locked: false
|
||||
|
||||
signal opened()
|
||||
|
||||
onOpened: {}
|
||||
|
|
|
@ -25,6 +25,7 @@ Page {
|
|||
signal refresh()
|
||||
|
||||
property int status: -1
|
||||
property bool locked: false
|
||||
|
||||
BusyIndicator {
|
||||
anchors.centerIn: parent
|
||||
|
|
|
@ -27,6 +27,7 @@ Page {
|
|||
title: "Einstellungen"
|
||||
|
||||
signal opened()
|
||||
property bool locked: false
|
||||
|
||||
onOpened: {}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
id: bigLogo
|
||||
source: "qrc:/graphics/images/FannyIcon.png"
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: window.height * 0.01
|
||||
}
|
||||
|
||||
height: window.height * 0.2
|
||||
height: parent.height * 0.6
|
||||
|
||||
|
||||
fillMode: Image.PreserveAspectFit
|
||||
mipmap: true
|
||||
smooth: true
|
||||
|
@ -52,38 +69,41 @@ Page {
|
|||
|
||||
Label {
|
||||
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>"
|
||||
wrapMode: Text.Wrap
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
onLinkActivated: {
|
||||
Qt.openUrlExternally(link)
|
||||
}
|
||||
|
||||
anchors {
|
||||
top: bigLogo.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
leftMargin: window.width * 0.05
|
||||
rightMargin: window.width * 0.05
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Column {
|
||||
spacing: ( height - 100 ) * 0.1
|
||||
id: formCol
|
||||
spacing: height * 0.01
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: infoText.bottom
|
||||
bottom: parent.bottom
|
||||
topMargin: root.height * 0.02
|
||||
bottomMargin: root.height * 0.2
|
||||
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
|
||||
placeholderText: "Benutzername"
|
||||
Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked)
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
|
@ -91,6 +111,11 @@ Page {
|
|||
right: parent.right
|
||||
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"
|
||||
Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked)
|
||||
|
||||
height: formCol.rowHeight
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: root.width * 0.05
|
||||
|
@ -200,6 +227,8 @@ Page {
|
|||
text: qsTr("Angemeldet bleiben")
|
||||
checked: true
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
height: formCol.rowHeight
|
||||
}
|
||||
|
||||
FancyButton {
|
||||
|
@ -208,55 +237,39 @@ Page {
|
|||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
left: parent.left
|
||||
margins: window.width * 0.05
|
||||
margins: root.width * 0.05
|
||||
}
|
||||
|
||||
height: formCol.rowHeight
|
||||
|
||||
text: qsTr("Anmelden")
|
||||
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 {
|
||||
id: laStatus
|
||||
text: qsTr("")
|
||||
font.pixelSize: 20
|
||||
font.pixelSize: height * 0.3
|
||||
color: "red"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
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]
|
||||
height: formCol.rowHeight
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,9 +31,11 @@ Page {
|
|||
sequences: ["Esc", "Back"]
|
||||
enabled: formStack.depth > 1
|
||||
onActivated: {
|
||||
if(!formStack.currentItem.locked){
|
||||
formStack.pop()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StackView {
|
||||
id: formStack
|
||||
|
@ -145,10 +147,8 @@ Page {
|
|||
width: height
|
||||
|
||||
onClicked: {
|
||||
if (formStack.depth > 1) {
|
||||
if(!formStack.currentItem.locked){
|
||||
formStack.pop()
|
||||
} else {
|
||||
drawer.open()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue