From b9cd6bf38e300c6bfca091bc434f732314a884ec Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 19 Dec 2015 16:08:10 -0800 Subject: 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 --- qt-mobile/qmlmanager.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'qt-mobile') 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(); -- cgit v1.2.3-70-g09d2