QML UI: allow changing credentials

With the integration of the credentials into the start page the logic for
this has changed.
Since the code for start page and dive list is actually on the same page,
using opacity to switch between the two sub pages (depending on whether we
have valid credentials and dives to show), the old way of changing
credentials no longer worked.
With theis patch the user once again can change their credentials (and
change their mind and go back to the dive list).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-02-10 18:09:16 -08:00
parent 055ec05e0f
commit 38f7fd6fbe
3 changed files with 29 additions and 6 deletions

View file

@ -12,6 +12,7 @@ MobileComponents.ApplicationWindow {
id: rootItem
title: qsTr("Subsurface-mobile")
property bool fullscreen: true
property int oldStatus: -1
FontMetrics {
id: fontMetrics
@ -38,8 +39,15 @@ MobileComponents.ApplicationWindow {
Action {
text: "Cloud credentials"
onTriggered: {
stackView.push(cloudCredWindow)
detailsWindow.endEditMode()
oldStatus = manager.credentialStatus
if (diveList.numDives > 0) {
manager.startPageText = "Enter different credentials or return to dive list"
} else {
manager.startPageText = "Enter valdi cloud storage credentials"
}
manager.credentialStatus = QMLManager.UNKNOWN
}
},
MobileComponents.ActionGroup {