- 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,194 +33,277 @@ Page {
} }
} }
Image { Grid {
id: bigLogo id: mainGrid
source: "qrc:/graphics/images/FannyIcon.png" columns: app.landscape() ? 2:1
rows: app.landscape() ? 1:2
spacing: 0
anchors { anchors.fill: parent
top: parent.top
left: parent.left
right: parent.right
margins: window.height * 0.01
}
height: window.height * 0.2 width: parent.width
fillMode: Image.PreserveAspectFit height: parent.height
mipmap: true
smooth: true
}
Label { Column {
id: infoText id: logoInfoCol
text: "<html>Bitte melde dich mit den Anmeldedaten der Fanny-Webseite an.
<a href='http://www.fanny-leicht.de/j34/index.php/aktuelles/vertretungsplan'>Weitere Informationen</a></html>"
wrapMode: Text.Wrap
onLinkActivated: {
Qt.openUrlExternally(link)
}
anchors { width: app.landscape() ? root.width * 0.5:root.width
top: bigLogo.bottom height: app.landscape() ? root.height:root.height * 0.3
left: parent.left
right: parent.right
leftMargin: window.width * 0.05
rightMargin: window.width * 0.05
}
}
Column { Image {
spacing: ( height - 100 ) * 0.1 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 { anchors {
top: parent.top left: parent.left
bottom: parent.bottom
right: parent.right right: parent.right
} }
width: visibleIcon.width
onClicked: { height: parent.height * 0.6
if(state === "visible"){
state = "invisible"
} fillMode: Image.PreserveAspectFit
else { mipmap: true
state = "visible" 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: "<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)
} }
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 { Column {
id: visibleIcon 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 { anchors {
top: parent.top top: parent.top
bottom: parent.bottom bottom: parent.bottom
right: parent.right right: parent.right
bottomMargin: parent.height * 0.25
topMargin: anchors.bottomMargin
} }
fillMode: Image.PreserveAspectFit width: visibleIcon.width
smooth: true
mipmap: true onClicked: {
source: "qrc:/graphics/icons/view.png" 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 { height: formCol.rowHeight
id: invisibleIcon
anchors { text: qsTr("Anmelden")
top: parent.top enabled: tiuname.length > 0 & tipasswd.length > 0
bottom: parent.bottom onClicked: root.login(tiuname.text, tipasswd.text, cBperm.checked)
right: parent.right }
bottomMargin: parent.height * 0.25 FancyButton {
topMargin: anchors.bottomMargin id: registerBt
}
fillMode: Image.PreserveAspectFit anchors {
smooth: true horizontalCenter: parent.horizontalCenter
mipmap: true left: parent.left
source: "qrc:/graphics/icons/hide.png" 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 { Dialog {
id: cBperm id: busyDialog
text: qsTr("Angemeldet bleiben") modal: true
checked: true closePolicy: "NoAutoClose"
anchors.horizontalCenter: parent.horizontalCenter 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 { Label {
id: loginButton width: busyDialog.availableWidth
text: "Anmelden..."
anchors { wrapMode: Label.Wrap
horizontalCenter: parent.horizontalCenter font.pixelSize: 12
left: parent.left }
margins: window.width * 0.05 }
} }
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.." // change the text to "Anmelden.."
loginButton.text = "Anmelden.." loginButton.text = "Anmelden.."
console.log(username, password, permanent)
// trigger the login fucntion of the cpp backend and store the return code // trigger the login fucntion of the cpp backend and store the return code
var ret = serverConn.login(username, password, permanent); 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
}
}
}
}
} }

View file

@ -31,7 +31,9 @@ Page {
sequences: ["Esc", "Back"] sequences: ["Esc", "Back"]
enabled: formStack.depth > 1 enabled: formStack.depth > 1
onActivated: { onActivated: {
formStack.pop() if(!formStack.currentItem.locked){
formStack.pop()
}
} }
} }
@ -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()
} }
} }