mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-08 01:16:17 +00:00
cloudstorage: better member name when updating authentication state
This isn't just about showing the PIN or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
95a8f951ba
commit
9c4782fa5c
2 changed files with 10 additions and 6 deletions
|
@ -41,7 +41,7 @@ void PreferencesNetwork::refreshSettings()
|
||||||
ui->cloud_background_sync->setChecked(prefs.cloud_background_sync);
|
ui->cloud_background_sync->setChecked(prefs.cloud_background_sync);
|
||||||
ui->save_uid_local->setChecked(prefs.save_userid_local);
|
ui->save_uid_local->setChecked(prefs.save_userid_local);
|
||||||
ui->default_uid->setText(QString(prefs.userid).toUpper());
|
ui->default_uid->setText(QString(prefs.userid).toUpper());
|
||||||
cloudPinNeeded();
|
updateCloudAuthenticationState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesNetwork::syncSettings()
|
void PreferencesNetwork::syncSettings()
|
||||||
|
@ -73,7 +73,7 @@ void PreferencesNetwork::syncSettings()
|
||||||
report_error(qPrintable(tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.")));
|
report_error(qPrintable(tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.")));
|
||||||
} else {
|
} else {
|
||||||
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
||||||
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
|
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(updateCloudAuthenticationState()));
|
||||||
connect(cloudAuth, SIGNAL(passwordChangeSuccessful()), this, SLOT(passwordUpdateSuccessfull()));
|
connect(cloudAuth, SIGNAL(passwordChangeSuccessful()), this, SLOT(passwordUpdateSuccessfull()));
|
||||||
cloudAuth->backend(email, password, "", newpassword);
|
cloudAuth->backend(email, password, "", newpassword);
|
||||||
ui->cloud_storage_new_passwd->setText("");
|
ui->cloud_storage_new_passwd->setText("");
|
||||||
|
@ -94,7 +94,7 @@ void PreferencesNetwork::syncSettings()
|
||||||
report_error(qPrintable(tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.")));
|
report_error(qPrintable(tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.")));
|
||||||
} else {
|
} else {
|
||||||
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
||||||
connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesNetwork::cloudPinNeeded);
|
connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesNetwork::updateCloudAuthenticationState);
|
||||||
cloudAuth->backend(email, password);
|
cloudAuth->backend(email, password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ void PreferencesNetwork::syncSettings()
|
||||||
report_error(qPrintable(tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.")));
|
report_error(qPrintable(tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.")));
|
||||||
}
|
}
|
||||||
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
||||||
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
|
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(updateCloudAuthenticationState()));
|
||||||
cloudAuth->backend(email, password, pin);
|
cloudAuth->backend(email, password, pin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ void PreferencesNetwork::syncSettings()
|
||||||
cloud->setBaseUrl(prefs.cloud_base_url);
|
cloud->setBaseUrl(prefs.cloud_base_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesNetwork::cloudPinNeeded()
|
void PreferencesNetwork::updateCloudAuthenticationState()
|
||||||
{
|
{
|
||||||
ui->cloud_storage_pin->setEnabled(prefs.cloud_verification_status == CS_NEED_TO_VERIFY);
|
ui->cloud_storage_pin->setEnabled(prefs.cloud_verification_status == CS_NEED_TO_VERIFY);
|
||||||
ui->cloud_storage_pin->setVisible(prefs.cloud_verification_status == CS_NEED_TO_VERIFY);
|
ui->cloud_storage_pin->setVisible(prefs.cloud_verification_status == CS_NEED_TO_VERIFY);
|
||||||
|
@ -131,6 +131,10 @@ void PreferencesNetwork::cloudPinNeeded()
|
||||||
ui->cloud_storage_new_passwd_label->setVisible(prefs.cloud_verification_status == CS_VERIFIED);
|
ui->cloud_storage_new_passwd_label->setVisible(prefs.cloud_verification_status == CS_VERIFIED);
|
||||||
if (prefs.cloud_verification_status == CS_VERIFIED) {
|
if (prefs.cloud_verification_status == CS_VERIFIED) {
|
||||||
ui->cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage (credentials verified)"));
|
ui->cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage (credentials verified)"));
|
||||||
|
} else if (prefs.cloud_verification_status == CS_INCORRECT_USER_PASSWD) {
|
||||||
|
ui->cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage (incorrect password)"));
|
||||||
|
} else if (prefs.cloud_verification_status == CS_NEED_TO_VERIFY) {
|
||||||
|
ui->cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage (PIN required)"));
|
||||||
} else {
|
} else {
|
||||||
ui->cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage"));
|
ui->cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void proxyType_changed(int i);
|
void proxyType_changed(int i);
|
||||||
void cloudPinNeeded();
|
void updateCloudAuthenticationState();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::PreferencesNetwork *ui;
|
Ui::PreferencesNetwork *ui;
|
||||||
|
|
Loading…
Add table
Reference in a new issue