summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-09-27 17:08:30 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-09-29 08:13:25 -0700
commit801b1bc5f52f6aa7678c07443e266e70417f7227 (patch)
treeedfee7a2cfcd7218e68648468e04ed78e6c89752 /mobile-widgets
parent46f10362fcfcab5a1f74baf19229a0229ba7f4db (diff)
downloadsubsurface-801b1bc5f52f6aa7678c07443e266e70417f7227.tar.gz
mobile: propagate "still PIN required status"
Makes sure that the CS_NEED_TO_VERIFY status is carried forward and sets the showPin flag that triggers the 2 different states in de QML UI. The new credential UI will have one page for username/passwd, used for setting up an account or switchting to a different account, and a second page to enter a PIN only. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index ada4f57c7..24a51dfe9 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -172,6 +172,9 @@ void QMLManager::openLocalThenRemote(QString url)
if (error) {
appendTextToLog(QStringLiteral("loading dives from cache failed %1").arg(error));
setNotificationText(tr("Opening local data file failed"));
+ // have cloud credentials, but there is no local repo (yet).
+ // this implies that the PIN verify is still to be done
+ setCredentialStatus(CS_NEED_TO_VERIFY);
} else {
// if we can load from the cache, we know that we have a valid cloud account
if (credentialStatus() == CS_UNKNOWN)
@@ -193,6 +196,10 @@ void QMLManager::openLocalThenRemote(QString url)
appendTextToLog(QStringLiteral("%1 dives loaded from cache").arg(dive_table.nr));
setNotificationText(tr("%1 dives loaded from local dive data file").arg(dive_table.nr));
}
+ if (credentialStatus() == CS_NEED_TO_VERIFY) {
+ appendTextToLog(QStringLiteral("have cloud credentials, but still needs PIN"));
+ setShowPin(true);
+ }
if (oldStatus() == CS_NOCLOUD) {
// if we switch to credentials from CS_NOCLOUD, we take things online temporarily
prefs.git_local_only = false;