Cloud storage: show in preferences if cloud account was verified

This should make it easier to figure out what's happening.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-06-14 14:06:44 -07:00
parent b5eb66545b
commit 4b120d1bf5
3 changed files with 6 additions and 3 deletions

View file

@ -109,6 +109,10 @@ void PreferencesDialog::cloudPinNeeded()
ui.cloud_storage_pin->setVisible(prefs.cloud_verification_status == CS_NEED_TO_VERIFY);
ui.cloud_storage_pin_label->setEnabled(prefs.cloud_verification_status == CS_NEED_TO_VERIFY);
ui.cloud_storage_pin_label->setVisible(prefs.cloud_verification_status == CS_NEED_TO_VERIFY);
if (prefs.cloud_verification_status == CS_VERIFIED)
ui.cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage (credentials verified)"));
else
ui.cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage"));
}
#define DANGER_GF (gf > 100) ? "* { color: red; }" : ""

View file

@ -429,7 +429,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_8b">
<widget class="QGroupBox" name="cloudStorageGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>

View file

@ -978,15 +978,14 @@ void CloudStorageAuthenticate::uploadFinished()
qDebug() << "Completed connection with cloud storage backend, response" << cloudAuthReply;
if (cloudAuthReply == "[VERIFIED]" || cloudAuthReply == "[OK]") {
prefs.cloud_verification_status = CS_VERIFIED;
emit finishedAuthenticate();
} else if (cloudAuthReply == "[VERIFY]") {
prefs.cloud_verification_status = CS_NEED_TO_VERIFY;
emit finishedAuthenticate();
} else {
prefs.cloud_verification_status = CS_INCORRECT_USER_PASSWD;
report_error("%s", qPrintable(cloudAuthReply));
MainWindow::instance()->getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error);
}
emit finishedAuthenticate();
}
void CloudStorageAuthenticate::uploadError(QNetworkReply::NetworkError error)