Fetch the Subsurface webservice userid if cloud credentials were given
This allows users to not have to worry about this userid anymore. Both the mobile app and the desktop app can now derive the userid from the cloud storage credentials. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
962341ae9f
commit
8f33403e4f
@ -209,6 +209,7 @@ MainWindow::MainWindow() : QMainWindow(),
|
||||
if (!locationProvider->hasLocationsSource()) {
|
||||
ui.menuFile->removeAction(ui.add_GPS_location_here);
|
||||
}
|
||||
|
||||
ui.mainErrorMessage->hide();
|
||||
graphics()->setEmptyState();
|
||||
initialUiSetup();
|
||||
|
||||
@ -385,10 +385,18 @@ void WebServices::resetState()
|
||||
SubsurfaceWebServices::SubsurfaceWebServices(QWidget *parent, Qt::WindowFlags f) : WebServices(parent, f)
|
||||
{
|
||||
QSettings s;
|
||||
if (!prefs.save_userid_local || !*prefs.userid)
|
||||
ui.userID->setText(s.value("subsurface_webservice_uid").toString().toUpper());
|
||||
else
|
||||
ui.userID->setText(prefs.userid);
|
||||
|
||||
// figure out if we know (or can determine) the user's web service userid
|
||||
QString userid(prefs.userid);
|
||||
if (userid.isEmpty())
|
||||
userid = s.value("subsurface_webservice_uid").toString().toUpper();
|
||||
if (userid.isEmpty() &&
|
||||
!same_string(prefs.cloud_storage_email, "") &&
|
||||
!same_string(prefs.cloud_storage_password, ""))
|
||||
userid = GpsLocation::instance()->getUserid(prefs.cloud_storage_email, prefs.cloud_storage_password);
|
||||
|
||||
ui.userID->setText(userid);
|
||||
|
||||
hidePassword();
|
||||
hideUpload();
|
||||
ui.progressBar->setFormat(tr("Enter User ID and click Download"));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user