summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-26 09:15:10 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-26 20:44:02 +0200
commit9c4782fa5c0eacf7ad13c649c70dab0036cafc4f (patch)
tree1951bf2d807fa0f3ba7c80f2898661d0f9cf3e7c /desktop-widgets
parent95a8f951ba3c2bababadaa39b4c39dcf72c382c1 (diff)
downloadsubsurface-9c4782fa5c0eacf7ad13c649c70dab0036cafc4f.tar.gz
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>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/preferences/preferences_network.cpp14
-rw-r--r--desktop-widgets/preferences/preferences_network.h2
2 files changed, 10 insertions, 6 deletions
diff --git a/desktop-widgets/preferences/preferences_network.cpp b/desktop-widgets/preferences/preferences_network.cpp
index fb782e5b7..493077430 100644
--- a/desktop-widgets/preferences/preferences_network.cpp
+++ b/desktop-widgets/preferences/preferences_network.cpp
@@ -41,7 +41,7 @@ void PreferencesNetwork::refreshSettings()
ui->cloud_background_sync->setChecked(prefs.cloud_background_sync);
ui->save_uid_local->setChecked(prefs.save_userid_local);
ui->default_uid->setText(QString(prefs.userid).toUpper());
- cloudPinNeeded();
+ updateCloudAuthenticationState();
}
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 '+'.")));
} else {
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()));
cloudAuth->backend(email, password, "", newpassword);
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 '+'.")));
} else {
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
- connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesNetwork::cloudPinNeeded);
+ connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesNetwork::updateCloudAuthenticationState);
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 '+'.")));
}
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
- connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
+ connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(updateCloudAuthenticationState()));
cloudAuth->backend(email, password, pin);
}
}
@@ -119,7 +119,7 @@ void PreferencesNetwork::syncSettings()
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->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);
if (prefs.cloud_verification_status == CS_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 {
ui->cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage"));
}
diff --git a/desktop-widgets/preferences/preferences_network.h b/desktop-widgets/preferences/preferences_network.h
index dedc2dc77..439670e71 100644
--- a/desktop-widgets/preferences/preferences_network.h
+++ b/desktop-widgets/preferences/preferences_network.h
@@ -19,7 +19,7 @@ public:
public slots:
void proxyType_changed(int i);
- void cloudPinNeeded();
+ void updateCloudAuthenticationState();
private:
Ui::PreferencesNetwork *ui;