summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-19 16:08:10 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-19 16:08:10 -0800
commitb9cd6bf38e300c6bfca091bc434f732314a884ec (patch)
tree78fb1fa9fd9d9cef49b9d476a46614f0848b3693
parente2d5bef0730d392382990d94e6df90cacff52a1d (diff)
downloadsubsurface-b9cd6bf38e300c6bfca091bc434f732314a884ec.tar.gz
QML-UI: actually show the right text for missing cloud credentials
If we have no credentials or invalid credentials, update the text on the start page accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-mobile/qmlmanager.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index 15510bf5e..d852ad333 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -55,11 +55,13 @@ void QMLManager::finishSetup()
setSaveCloudPassword(prefs.save_password_local);
// if the cloud credentials are valid, we should get the GPS Webservice ID as well
if (!same_string(prefs.cloud_storage_email, "") &&
- !same_string(prefs.cloud_storage_password, ""))
+ !same_string(prefs.cloud_storage_password, "")) {
+ appendTextToLog("have cloud credentials, trying to connect");
tryRetrieveDataFromBackend();
- else
- m_startPageText = "No recorded dives found. You can download your dives to this device from the Subsurface cloud storage service, from your dive computer, or add them manually.";
-
+ } else {
+ appendTextToLog("no cloud credentials, tell user no dives found");
+ setStartPageText(tr("No recorded dives found. You can download your dives to this device from the Subsurface cloud storage service, from your dive computer, or add them manually."));
+ }
setDistanceThreshold(prefs.distance_threshold);
setTimeThreshold(prefs.time_threshold / 60);
}
@@ -158,6 +160,7 @@ void QMLManager::provideAuth(QNetworkReply *reply, QAuthenticator *auth)
auth->password() == QString(prefs.cloud_storage_password)) {
// OK, credentials have been tried and didn't work, so they are invalid
appendTextToLog("Cloud credentials are invalid");
+ setStartPageText(tr("No recorded dives found. You can download your dives to this device from the Subsurface cloud storage service, from your dive computer, or add them manually."));
reply->disconnect();
reply->abort();
reply->deleteLater();