QML UI: more accurate messages on the start page

Now the text shown better reflects what's going on, especially when the
credentials are invalid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-02-10 17:31:52 -08:00
parent 6829d10086
commit b7e353b7f6

View file

@ -49,7 +49,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
appendTextToLog(QStringLiteral("build with Qt Version %1, runtime from Qt Version %2").arg(QT_VERSION_STR).arg(qVersion())); appendTextToLog(QStringLiteral("build with Qt Version %1, runtime from Qt Version %2").arg(QT_VERSION_STR).arg(qVersion()));
qDebug() << "Starting" << getUserAgent(); qDebug() << "Starting" << getUserAgent();
qDebug() << QStringLiteral("build with Qt Version %1, runtime from Qt Version %2").arg(QT_VERSION_STR).arg(qVersion()); qDebug() << QStringLiteral("build with Qt Version %1, runtime from Qt Version %2").arg(QT_VERSION_STR).arg(qVersion());
m_startPageText = tr("Searching for dive data"); setStartPageText(tr("Starting..."));
// create location manager service // create location manager service
locationProvider = new GpsLocation(&appendTextToLogStandalone, this); locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
set_git_update_cb(&gitProgressCB); set_git_update_cb(&gitProgressCB);
@ -93,13 +93,13 @@ void QMLManager::finishSetup()
setSaveCloudPassword(prefs.save_password_local); setSaveCloudPassword(prefs.save_password_local);
// if the cloud credentials are valid, we should get the GPS Webservice ID as well // if the cloud credentials are valid, we should get the GPS Webservice ID as well
QString url; QString url;
if (!same_string(prefs.cloud_storage_email, "") && if (!cloudUserName().isEmpty() &&
!same_string(prefs.cloud_storage_password, "") && !cloudPassword().isEmpty() &&
getCloudURL(url) == 0) { getCloudURL(url) == 0) {
openLocalThenRemote(url); openLocalThenRemote(url);
} else { } else {
appendTextToLog(QStringLiteral("no cloud credentials, tell user no dives found")); appendTextToLog(QStringLiteral("no cloud credentials"));
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.")); setStartPageText(tr("Please enter valid cloud credentials."));
} }
setDistanceThreshold(prefs.distance_threshold); setDistanceThreshold(prefs.distance_threshold);
setTimeThreshold(prefs.time_threshold / 60); setTimeThreshold(prefs.time_threshold / 60);